help – Zimbra logs big. Out of space

My zimbra mailbox server was not working and discovered that I was out of space.
The first file I emptied was /opt/zimbra/log/zmlogswatch.out This file was 300GB. I saw in the zimbra forum that it was okay to delete this file. Second my zmconfigd would not start because my / was full.
I had tons of log files taking up space and was not being logrotated properly: mail.info, mail.log, zimbra.log, and zimbra-stats.log
I modified file /etc/logrotate.d/rsyslog and edited this section

/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log
{
size 100000k
rotate 14
#weekly
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
reload rsyslog >/dev/null 2>&1 || true
endscript
}

this file might be write protected:
do chmod +w /etc/logrotate.d/zimbra

/var/log/zimbra.log {
daily
rotate 14
size 100000k
missingok
notifempty
create 0644 syslog adm
postrotate
/usr/sbin/service rsyslog restart >/dev/null || true
su – zimbra -c “/opt/zimbra/bin/zmswatchctl restart” > /dev/null 2>&1 || true
endscript
compress
}

/var/log/zimbra-stats.log {
daily
size 100000k
rotate 14
compress
notifempty
create 0644 syslog adm
postrotate
/usr/sbin/service rsyslog restart >/dev/null || true
su – zimbra – c “/opt/zimbra/bin/zmlogswatchctl restart” > /dev/null 2>&1 || true
endscript
rotate 0
}

chmod -w /etc/logrotate.d/zimbra

added to cron to run hourly
cp /etc/cron.daily/logrotate /etc/cron.hourly

Leave a Reply