gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 12:45:15 25 4
gpt4 key购买 nike

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com