FC10 -- adding /var/log/messages to daily logrotate

Sharpe, Sam J sam.sharpe+lists.redhat at gmail.com
Wed Sep 23 20:36:54 UTC 2009


2009/9/23 Robert Moskowitz <rgm at htt-consult.com>:
> I just discovered that /var/log/messages is NOT part of the daily logrotate
> on my FC10 netbook.  My drive was full with a 4Gb messages file.  Deleted it
> and now the system is working right again.
>
> So I want to add it to the daily rotate.  Is there an easy way to set this
> up?
>
> More importantly why is it NOT part of the daily rotate?

It has been part of the (weekly) log rotation for as long as I remember.

Is your /var/log/secure log rotated correctly?

- You should have /etc/cron.daily/logrotate, which runs logrotate daily.

- You should have /etc/logrotate.conf which sets some defaults, notably:
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

- You should then have something like the following script:

[sam at samlap ~]$ cat /etc/logrotate.d/syslog
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler
/var/log/boot.log /var/log/cron {
    sharedscripts
    postrotate
	/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

But as I said before, I believe the messages log is on weekly
rotation, not daily and depends on cron.daily running...

-- 
Sam




More information about the users mailing list