[CentOS] Logrotate base

Thu Feb 12 05:08:24 UTC 2009
Fajar Priyanto <fajarpri at arinet.org>

On Thu, Feb 12, 2009 at 12:12 PM, muhammad panji <sumodirjo at gmail.com> wrote:
> On Thu, Feb 12, 2009 at 11:05 AM, Fajar Priyanto <fajarpri at arinet.org> wrote:
>> Hi guys,
>> Logrotate is checked every day by cron.daily, right?
>> I notice in logrotate.conf by default it's weekly.
>> If I change it into monthly (now, on 12 of Feb), when will it do the
>> monthly rotation?
> AFAIK it is a default value to rotate the log file which could be
> override by individual configuration on /etc/logrotate.d/
> so if it the individual configuration doesn't specify the rotation
> period it will use the default which is weekly

My question is changing weekly to monthly.

Anyway, after googling2, I found this very good indepth article on
logrotate, thought I share it here:
http://www.softpanorama.org/Logs/Log_rotation/logrotate.shtml
One item that you didn't cover, is how logrotate knows when it is the
proper time to rotate a daily, weekly, or monthly file. Part of that
is controlled by the status file (/var/lib/logrotate.status on most
Linux system) which tracks when a particular file was last rotated.
The other part is that Monthly rotations are done with the first run
of logrotate that month, and Weekly's are run if the last run was
later in the previous week, or the last rotation was over 7 days prior
(Sunday=0 Saturday=6). So if you are running logrotate daily, then it
works itself out to the first day of the month, and Sunday's for the
weeklies.
So, it will be March 1st.