在过去的几天里,我每天从cron的logrotate任务获得邮件:
/etc/cron.daily/logrotate:
gzip:stdin:压缩时文件大小已更改
我该如何解决?
谢谢,
吉安·马可(Gian Marco)。
最佳答案
这是a blog post in French提供了解决方案。
用英语,您可以阅读this bug report。
总结一下:
首先,您必须在脚本--verbose
中添加/etc/cron.daily/logrotate
选项,以在下次运行时获得更多信息,以识别哪个旋转日志导致了问题。
#!/bin/sh
test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate --verbose /etc/logrotate.conf`
接下来,您必须在logrotate配置中添加
delaycompress
选项。像示例一样,我在/etc/logrotate.d/nginx中添加了nginx的logrotate配置:
/var/log/nginx/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 0640 www-data adm
sharedscripts
...
}
关于email - 如何修复“/etc/cron.daily/logrotate:gzip:stdin:压缩时文件大小已更改”?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31155418/