Covington, Chris wrote:

On Sun, 2005-01-16 at 12:21 -0600, Ben Maas wrote:


Covington, Chris wrote:


Hi all,

How can I make sure that my weekly logrotation occurs on Sunday
morning?


You'll need to change your crontab.

First though, I assume this means you don't want you logs to be rotated dailty as is the default when you emerge logrotate. The dafault is that the /etc/cron.daily/logrotate.cron script is run daily, which rotates your logs.



but the logrotate.cron cron job occurs /etc/cron.daily. On my Red Hat systems, this 'weekly' rotation always occurs Sunday morning (for instance, with /var/log/maillog) and the logrotate cron job still runs in /etc/cron.daily. On my Gentoo system I have syslog-ng.conf setup like the example on http://www.gentoo.org/doc/en/gentoo-security.xml and I also have /etc/cron.daily/logrotate.cron but my maillog didn't rotate this morning (I'm using Postfix as the MTA). My /var/lib/logrotate.status on the Gentoo system looks like this:

grendel log # cat /var/lib/logrotate.status
logrotate state -- version 2
"/var/log/messages" 2005-1-16
"/var/log/wtmp" 2005-1-16

For some reason /var/log/maillog isn't in there,
although /var/log/maillog exists.


You may modify the file /etc/logrotate.d/syslog-ng.
Just extend the messages entry:
/var/log/messages /var/log/maillog {
   sharedscripts
   postrotate
       /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
   endscript
}


Peter


-- [email protected] mailing list



Reply via email to