I noticed that daily log rotations which are listed under /etc/logrotate.d/
are executed in the morning around 6:40 am. This is clear from the beginning and ending of the log files. Can I customize this time and set it to midnight for example?
It is nice to have one log file per day.
I am using ubuntu server 10.04 if that matters.
Edit in
/etc/crontab
the line that saysso that the
25 6
reads0 0
. This will make it so that all scripts in/etc/cron.daily
runs at midnight.If you only want to make logrotate run at midnight, move
/etc/cron.daily/logrotate
to some other directory, and add the lineat the end of
/etc/crontab
.If you have Webmin/Virtualmin installed on your server you can change your logrotate execution time easier:
Just go to
Webmin -> Scheduled Cron Jobs
and Select daily cron. Modify it as you want and save it.