Why would logrotate run at odd time?
I have a logrotate script shown below. It is set to run monthy. It has been working fine for about a year and a half. This morning, on the 17th of the month, it ran. I have no clue why. Any ideas?
Slackware64 14.1 (up-to-date) Code:
/etc/intrude/blockIP /etc/logfiles/scanCdrives.log |
Just a hunch...full space? But...it's just a loose idea...perhaps I started an avalance of ideas ^^
Melissa |
mfoley --
Just a WAG ... Are you in the USA ? Could it be because Daylight Saving Time started last weekend ? -- kjh |
Quote:
|
This script is in /etc/logrotate.d/MAIL -- a separate file from the shipped-defaults. It is run via the usual convoluted yet standard mechanism: root's crontab > /etc/cron.daily/crontab > /usr/sbin/logrotate / etc/logrotate.conf, the latter of which includes the folder /etc/logrotate.d.
It used to run at the beginning of the month, only, see below. Notice that the new log files are on the last or first day of the month for every month, except a new logfile was created on the 17th of this month. Code:
-rw-r--r-- 1 root root 41259 2015-05-01 02:47 blockIP.12 Code:
-rwxr-x--- 1 root root 35622 2015-07-01 00:59 blockIP.10* |
Quote:
Quote:
Code:
ls -lrt /var/log/packages | tail -n 20 |
Quote:
Quote:
But, output is: Code:
> ls -lrt /var/log/packages | tail -n 20 |
Is there anything interesting in syslog or messages around that time?
|
Another way this can happen is if /var/lib/logrotate.status gets deleted (or mangled). Normally, the daily cron job will run logrotate, logrotate sees the "monthly" directive, and checks logrotate.status to see if it already rotated that file this month. If you lose the information in logrotate.status, the next daily run will be "first in the month".
Also, be aware that the timestamp on the rotated files is the time the last message was written to that file before rotation - not the rotation time. |
As of today (April 1) the montly log files are back to rotating monthly (if 1 month's worth is a sufficient test). No idea what happened, nothing in syslog gives a clue. I guess I'll just forget about it unless there are further occurances.
|
All times are GMT -5. The time now is 05:58 AM. |