Log Turnover Problems

bizdev at pwnspeak.com bizdev at pwnspeak.com
Fri Nov 5 17:28:24 UTC 2010


On Fri, 5 Nov 2010 09:48:57 -0500, C de-Avillez <hggdh2 at ubuntu.com> wrote:

> On Thu, 04 Nov 2010 21:35:31 -0400

> <bizdev at pwnspeak.com> wrote:

> 

> <snip/>

> 

>> This has never been edited.  It still contains the default values for

>> cron.daily.  How can I make the log's rotate at midnight as expected?

> 

> anacron is usually fired from cron. Your '/etc/crontab' should have

> entries similar to the following:

> 

> # m h dom mon dow user  command

> 17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly

> 25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts

> --report /etc/cron.daily )

> 47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts

> --report /etc/cron.weekly )

> 52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts

> --report /etc/cron.monthly )

> 

> So you would need to change the hours and minutes at least for the

> cron.daily line (mine, for example, fires off every day at 0625).

> 

> Please note that although anacron will be run at the time specified in

> the '/etc/crontab', the individual jobs it fires may have other delays,

> as set in the '/etc/anacrontab' file.

> 

> One more option you can have: add a line to '/etc/crontab' for

> logrotate, and set the schedule to what you want.

> 

> Cheers,



This is exactly what I was looking for.  



In a server type environment it is beneficial to have the logs turnover at

midnight so cheking past logs is a day per day task rather than stat'ing

your days per 6:25am each day.  Midnight is a much better choice.



Thanks, I'm goin to have these removed and rotate my logs manually through

a root crontab, and get rid of the daily syslog and logrotate logs all

together.



Thanks again,

Tim H.




More information about the ubuntu-users mailing list