in last days i get daily mail from cron's logrotate task:
/etc/cron.daily/logrotate:
gzip: stdin: file size changed while zipping
How can I fix it?
Thanks, Gian Marco.
Here's a blog post in French which gives a solution.
In English, you can read this bug report.
To summarise:
First you have to add the --verbose
option in the script /etc/cron.daily/logrotate
to have more information the next time it runs to identify which rotation log cause the problem.
#!/bin/sh test -x /usr/sbin/logrotate || exit 0 /usr/sbin/logrotate --verbose /etc/logrotate.conf`
Next you have to add the delaycompress
option in logrotate configuration.
Like exemple, I add the nginx's logrotate configiguration in /etc/logrotate.d/nginx:
/var/log/nginx/*.log { daily missingok rotate 14 compress delaycompress notifempty create 0640 www-data adm sharedscripts ... }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With