Fix zimbra logrotate issues
If this error occurs on a host with Zimbra installed:
/etc/cron.daily/logrotate: error: zimbra:64 unexpected text
It’s due to a typographical error in /etc/logrotate.d/zimbra that has not been fixed in the latest release (6.0.3.) The log rotate configuration file for Zimbra as delivered has a typographical error in the freshclam section.
1 2 3 4 5 6 7 8 9 10 11 12 | /opt/zimbra/log/freshclam.log {
daily
missingok
copytruncate
notifempty create 0660 zimbra zimbra
postrotate
kill -HUP `cat /opt/zimbra/log/freshclam.pid 2> /dev/null` 2> /dev/null || true
endscript
compress
size 5000k
rotate 7
} |
On line five, the notifempty and create 0660 zimbra zimbra have been concatenated together. To fix, just move the create stanza to the next line like so.
1 2 3 4 5 6 7 8 9 10 11 12 13 | /opt/zimbra/log/freshclam.log {
daily
missingok
copytruncate
notifempty
create 0660 zimbra zimbra
postrotate
kill -HUP `cat /opt/zimbra/log/freshclam.pid 2> /dev/null` 2> /dev/null || true
endscript
compress
size 5000k
rotate 7
} |
Be aware that since this isn’t officially fixed from the folks at Zimbra, any updates applied after this change is made may revert this back to the original, broken behavior.
Enjoy.