Well i'm doing some test on "logrotate"
Here are settings ================================================================================ # more /etc/logrotate.d/exim /var/log/exim/*.log { missingok rotate 5 notifempty daily sharedscripts postrotate /bin/kill -HUP `cat /var/run/exim.pid* 2>/dev/null` 2> /dev/null || true endscript } ================================================================================ # more /etc/crontab SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/
# run-parts #m h dom mon dow usercommand 01 * * * * root run-parts /etc/cron.hourly 01 20 * * * root run-parts /etc/cron.daily 22 4 * * 0 root run-parts /etc/cron.weekly 42 4 1 * * root run-parts /etc/cron.monthly ================================================================================ # /etc/init.d/crond restart Stopping crond: [ OK ] Starting crond: [ OK ] ================================================================================
Means , "/var/log/exim/*.log" should be rotated daily at "20:01 " right ???
But i'm seeing like this: ================================================================================ Before 20:01 ================================================================================ # ls -lut /var/log/exim/main.log* -rw-r----- 1 mailnull mailnull 155243 Apr 9 19:51 /var/log/exim/main.log -rw-r----- 1 mailnull mailnull 0 Apr 9 19:51 /var/log/exim/main.log.1 -rw-r----- 1 mailnull mailnull 0 Apr 9 19:51 /var/log/exim/main.log.2 -rw-r----- 1 mailnull mailnull 0 Apr 9 19:51 /var/log/exim/main.log.3 -rw-r----- 1 mailnull mailnull 0 Apr 9 19:51 /var/log/exim/main.log.4 -rw-r----- 1 mailnull mailnull 0 Apr 9 19:51 /var/log/exim/main.log.5 ================================================================================ After 20:01 # ls -l /var/log/exim/main.log* -rw-r----- 1 mailnull mailnull 156181 Apr 9 20:03 /var/log/exim/main.log -rw-r----- 1 mailnull mailnull 0 Apr 9 19:49 /var/log/exim/main.log.1 -rw-r----- 1 mailnull mailnull 0 Apr 9 19:49 /var/log/exim/main.log.2 -rw-r----- 1 mailnull mailnull 0 Apr 9 19:49 /var/log/exim/main.log.3 -rw-r----- 1 mailnull mailnull 0 Apr 9 19:49 /var/log/exim/main.log.4 -rw-r----- 1 mailnull mailnull 0 Apr 9 19:49 /var/log/exim/main.log.5 ================================================================================
I see only the Time stamp of files have changed...,but contents of 'main.log' to not moved to 'main.log.1'
Any settings i'm missing ??
Thanks -Dilip