jeudi 7 juillet 2016

logrotate didn't rotate my log

I turned on mysql general log, and since it was growing pretty fast I thought of using logrotate daily, so I created the log yesterday at about 2pm and this is how the log looks like:

-rw-rw----  1 mysql adm  1751348 Jun 16 11:55 general.log

I added a new rule to logrotate which looks like this:

/var/log/mysql/general.log {
daily
rotate 12
dateext
compress
missingok
notifempty
create 640 mysql adm
postrotate
        /usr/bin/killall -HUP rsyslogd
    endscript
}

And according to /etc/crontab it runs at 6:25am, but it didn't rotate my log yesterday

25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

What else do I have to do so it rotates my log?

Aucun commentaire:

Enregistrer un commentaire