How to rotate /var/log/zimbra.log for 365 days?

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
xiebo
Posts: 15
Joined: Sat Sep 13, 2014 2:07 am

How to rotate /var/log/zimbra.log for 365 days?

Post by xiebo »

I am using Zimbra 7.1 and /var/log directory has 5 files:

zimbra.log

zimbra.log.1.gz

zimbra.log.2.gz

zimbra.log.3.gz

zimbra.log.4.gz
It seems that it could only save the last 4 days /var/log/zimbra.log file.
I want to save the last 365 days /var/log/zimbra.log file. How to do it?
User avatar
justdave
Advanced member
Advanced member
Posts: 122
Joined: Fri Sep 12, 2014 11:54 pm
ZCS/ZD Version: 8.8.9.GA.3019.UBUNTU16.64 FOSS

How to rotate /var/log/zimbra.log for 365 days?

Post by justdave »

you can edit the rotation script in /etc/logrotate.d/zimbra
Check 'man logrotate' for the script syntax. you probably want to add a 'rotate 365' or somesuch, but I'd doublecheck the man page to make sure. Note that'll also use a lot of disk space. Make sure you have enough. :)
That file will get overwritten by the Zimbra installer any time you upgrade, so you'll need to remember to edit it again after an upgrade.
Post Reply