linux 忽略错误信息,linux – 由于文件模式错误而忽略/etc/logrotate.conf

我如何做logrotate,当我做logrotate时,我看不出任何效果

root@me-Latitude-E5550:/etc/logrotate.d# cd ..

root@me-Latitude-E5550:/etc# cd ..

root@me-Latitude-E5550:/# logrotate -d /etc/logrotate.conf

Ignoring /etc/logrotate.conf because of bad file mode.

Handling 0 logs

root@me-Latitude-E5550:/# chmod 644 /etc/logrotate.d/*

root@me-Latitude-E5550:/# cd /etc/logrotate.d

root@me-Latitude-E5550:/etc/logrotate.d# ls

apport custom pm-utils speech-dispatcher upstart

apt dpkg ppp ufw

cups-daemon lightdm rsyslog unattended-upgrades

root@me-Latitude-E5550:/etc/logrotate.d# cd ..

root@me-Latitude-E5550:/etc# cd ..

root@me-Latitude-E5550:/# logrotate -d /etc/logrotate.conf

Ignoring /etc/logrotate.conf because of bad file mode.

Handling 0 logs

root@me-Latitude-E5550:/# cd /var/log

root@me-Latitude-E5550:/var/log# ls -larth

total 34M

drwxrwxrwx 2 root root 4,0K Feb 18 2016 speech-dispatcher

drwxrwxrwx 2 root root 4,0K Mai 19 2016 upstart

drwxrwxrwx 2 root root 4,0K Jul 19 2016 fsck

-rwxrwxrwx 1 root root 31 Jul 19 2016 dmesg

-rwxrwxrwx 1 root root 57K Jul 19 2016 bootstrap.log

drwxrwxrwx 3 root root 4,0K Jul 19 2016 hp

drwxr-xr-x 14 root root 4,0K Jul 19 2016 ..

drwxrwxrwx 2 root root 4,0K Jun 14 13:17 apt

drwxrwxrwx 2 root root 4,0K Jun 14 13:20 installer

drwxrwxrwx 2 root root 4,0K Jun 19 09:50 unattended-upgrades

-rwxrwxrwx 1 root root 3,8K Jun 19 09:55 fontconfig.log

-rwxrwxrwx 1 root root 554 Jun 19 15:02 apport.log.1

drwxrwxrwx 2 root root 4,0K Jun 20 07:35 lightdm

-rwxrwxrwx 1 root root 836K Jun 20 07:35 syslog.1

-rwxrwxrwx 1 root root 32K Jun 20 14:31 faillog

-rw------- 1 root utmp 768 Jul 14 09:28 btmp

drwxrwxrwx 2 root root 4,0K Jul 14 10:38 dist-upgrade

-rwxrwxrwx 1 root root 43K Jul 14 10:45 alternatives.log

-rwxrwxrwx 1 root root 286K Jul 14 11:04 lastlog

drwxrwxrwx 2 root root 4,0K Jul 18 08:59 sysstat

-rwxrwxrwx 1 root root 1,8M Jul 18 11:13 dpkg.log

drwxrwxrwx 2 root root 4,0K Jul 18 12:19 cups

-rw-r----- 1 root adm 14K Jul 18 12:20 apport.log

-rw-r--r-- 1 root root 32K Jul 18 18:38 Xorg.0.log.old

-rwxrwxrwx 1 root root 1,9K Jul 18 18:44 gpu-manager.log

-rw-r--r-- 1 root root 1009 Jul 18 18:44 boot.log

drwxrwxr-x 13 root syslog 4,0K Jul 18 18:44 .

-rw-rw-r-- 1 root utmp 85K Jul 18 18:45 wtmp

-rw-r--r-- 1 root root 29K Jul 18 21:17 Xorg.0.log

-rwxrwxrwx 1 root root 5,7M Jul 18 21:18 kern.log

-rwxrwxrwx 1 root root 580K Jul 18 21:50 auth.log

-rwxrwxrwx 1 root root 24M Jul 18 21:54 syslog

root@me-Latitude-E5550:/var/log# logrotate -f /etc/logroate.conf

error: cannot stat /etc/logroate.conf: No such file or directory

root@me-Latitude-E5550:/var/log# logrotate -f /etc/logrotate.conf

root@me-Latitude-E5550:/var/log# ls -larth

total 34M

drwxrwxrwx 2 root root 4,0K Feb 18 2016 speech-dispatcher

drwxrwxrwx 2 root root 4,0K Mai 19 2016 upstart

drwxrwxrwx 2 root root 4,0K Jul 19 2016 fsck

-rwxrwxrwx 1 root root 31 Jul 19 2016 dmesg

-rwxrwxrwx 1 root root 57K Jul 19 2016 bootstrap.log

drwxrwxrwx 3 root root 4,0K Jul 19 2016 hp

drwxr-xr-x 14 root root 4,0K Jul 19 2016 ..

drwxrwxrwx 2 root root 4,0K Jun 14 13:17 apt

drwxrwxrwx 2 root root 4,0K Jun 14 13:20 installer

drwxrwxrwx 2 root root 4,0K Jun 19 09:50 unattended-upgrades

-rwxrwxrwx 1 root root 3,8K Jun 19 09:55 fontconfig.log

-rwxrwxrwx 1 root root 554 Jun 19 15:02 apport.log.1

drwxrwxrwx 2 root root 4,0K Jun 20 07:35 lightdm

-rwxrwxrwx 1 root root 836K Jun 20 07:35 syslog.1

-rwxrwxrwx 1 root root 32K Jun 20 14:31 faillog

-rw------- 1 root utmp 768 Jul 14 09:28 btmp

drwxrwxrwx 2 root root 4,0K Jul 14 10:38 dist-upgrade

-rwxrwxrwx 1 root root 43K Jul 14 10:45 alternatives.log

-rwxrwxrwx 1 root root 286K Jul 14 11:04 lastlog

drwxrwxrwx 2 root root 4,0K Jul 18 08:59 sysstat

-rwxrwxrwx 1 root root 1,8M Jul 18 11:13 dpkg.log

drwxrwxrwx 2 root root 4,0K Jul 18 12:19 cups

-rw-r----- 1 root adm 14K Jul 18 12:20 apport.log

-rw-r--r-- 1 root root 32K Jul 18 18:38 Xorg.0.log.old

-rwxrwxrwx 1 root root 1,9K Jul 18 18:44 gpu-manager.log

-rw-r--r-- 1 root root 1009 Jul 18 18:44 boot.log

drwxrwxr-x 13 root syslog 4,0K Jul 18 18:44 .

-rw-rw-r-- 1 root utmp 85K Jul 18 18:45 wtmp

-rw-r--r-- 1 root root 29K Jul 18 21:17 Xorg.0.log

-rwxrwxrwx 1 root root 5,7M Jul 18 21:18 kern.log

-rwxrwxrwx 1 root root 580K Jul 18 21:50 auth.log

-rwxrwxrwx 1 root root 24M Jul 18 21:55 syslog

root@me-Latitude-E5550:/var/log#

解决方法:

您正在更改logrotate.d的权限.你需要chmod 644 /etc/logrotate.conf

并且chown root:root /etc/logrotate.conf

然后它可以工作

标签:linux,logrotate,logs

来源: https://codeday.me/bug/20190813/1646722.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值