Entries Tagged as 'logrotate.status'

logrotate的一个诡异问题

今天听说有台机器的某些log没有被正确rotate
我就上去看
发现配置并没有问题呀
于是看log
/var/log/cron
看到cron.daily还是定时跑了的
再看
/var/spool/mail/root
发现错误提示了:

/etc/cron.daily/logrotate:

error: bad year 1991 for file /var/account/pacct in state file /var/lib/logrotate.status

ls -l /var/account/pacct

-rw——- 1 root root 83996800 Feb 14 17:25 /var/account/pacct
这个时间戳没有问题
再看文件/var/lib/logrotate.satus
发现

“/var/account/pacct” 1991-4-14

把这一行删掉
再跑logrotate
logrotate -f /etc/logrotate.conf
还是报另外一个文件的时间”年”1991有问题
再编辑/var/lib/logrotate.status文件
把所有1991年的都删掉
再重新跑logrotate
这个世界终于安静了
:)
不明白,一点都没搞明白到底是为什么