rotation of mail.log weekly instead of daily PDF Print E-mail
User Rating: / 2
PoorBest 
Written by Bart Dorlandt   
Thursday, 02 July 2009 14:38

I wanted to rotate my mail.log on a weekly basis instead of daily. Here are the steps to realize this.

First make sure not rotate this file on a daily basis.

edit: /etc/cron.daily/sysklogd (around line 34)

logs=$(syslogd-listfiles)

change it to:

logs=$(syslogd-listfiles -s mail.log)

edit: /etc/cron.weekly/sysklogd (around line 34)

logs=$(syslogd-listfiles --weekly)

change it to:

logs=$(syslogd-listfiles --weekly -s mail.log)

before the restart syslogd command, add the following line

savelog -g adm -m 640 -u ${USER} -c 4 /var/log/mail.log >/dev/null

This will do the trick. Now you can use other scripts that make a weekly use of the mail.log. Like spam stats or pflogsumm. You can find these scripts here. On page 3 (mailserver)

Here is the forum I used to find some info as well.

Last Updated on Wednesday, 22 July 2009 13:23
 


Related items: