logrotate deletes all maillogs older than one day

Posted by shadyabhi on Server Fault See other posts from Server Fault or by shadyabhi
Published on 2012-09-20T09:16:07Z Indexed on 2012/09/20 9:40 UTC
Read the original article Hit count: 247

Filed under:
|

I see only two files maillog and maillog.1 in /var/log.

grepping for maillog in logrotate.d directory gives three files that have a mention of maillog.

syslog

/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
#/var/log/messages /var/log/secure /var/log/spooler /var/log/boot.log /var/log/cron {
        daily
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
        /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

syslog-ng

/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron /var/log/kern.log /var/log/kern {
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
        /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

and maillog.

/var/log/maillog  {
    daily
    compress
#    rotate 365
    rotate 14 
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
        /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

I am new to logrotate so may be I am missing something obvious. What can be the issue? The setup was already done when I started managing the server so I don't also know as do why do I have 3 mentions for maillog in logrotate.

© Server Fault or respective owner

Related posts about log-files

Related posts about logrotate