email - 如何修复“/etc/cron.daily/logrotate:gzip:stdin:压缩时文件大小已更改”?

标签 email logrotate

在过去的几天里,我每天从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/

相关文章:

linux - 通过电子邮件正文中的日志获取 cronjob 脚本执行的日志

linux - logrotate配置文件开发与测试

linux - logrotate 说在旋转日志/重新创建日志文件时权限被拒绝

html - html 电子邮件中的背景图像 css - Gmail 不支持

html - 如何去除电子邮件客户端(如 Outlook 2007)中损坏/卸载图像的边框?

email - Outlook 中电子邮件的简短预览显示图像 src 而不是替代文本

docker - 在 docker 容器中轮换应用程序日志

linux - 压缩删除logrotate中的日志

php - 如何使用 php 日志配置 logrotate

html - 转发响应式电子邮件,同时保留媒体查询