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

Robert Moskowitz rgm at htt-consult.com
Wed Sep 23 20:54:23 UTC 2009


Sharpe, Sam J wrote:
> 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...


OOPS.  My bad.

I see now that messages IS being rotated.  It was just so big due to an 
app that was dumping into it that it grew to 4Gb in a single day and 
filled up my /var partition.

BAD app.  BAD app.  Go in the corner until you can behave.

:)

I turned debug off on it while I work with the developers....





More information about the fedora-list mailing list