LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Question about logrotate and weekly rotation (https://www.linuxquestions.org/questions/linux-server-73/question-about-logrotate-and-weekly-rotation-4175414591/)

circus78 07-03-2012 02:54 AM

Question about logrotate and weekly rotation
 
Hi,
first of all, I noticed that the man page into debian and centos is different:

CentOS 5.8 Final
Quote:

weekly Log files are rotated if the current weekday is less then the weekday of the last rotation or if more then a week has passed since the last rotation. This is normally the same as rotating logs on the first day of the week, but it works better if logrotate is not run every night.
Debian
Quote:

weekly Log files are rotated if the current weekday is less than the weekday of the last rotation or if more than a week has passed since the last rotation. This is normally the same as rotating logs on the first day of the week, but if logrotate is not being run every night a log rotation will happen at the first valid opportunity.
I've problem in Debian, because I've this conf file for mail.log:

/var/log/mail.log {
weekly
rotate 52
..
}

but it's still rotating log daily.
On my system, logrotate is running every day at 6.25 (default)
It seems that mail.log is rotating daily AND weekly (look at 6:47 time)

Quote:

-rw-r----- 1 root adm 413567 2012-07-03 09:47 mail.log
-rw-r----- 1 root adm 3127213 2012-07-03 06:26 mail.log.0
-rw-r----- 1 root adm 168529 2012-06-24 06:25 mail.log.10.gz
-rw-r----- 1 root adm 3369 2012-06-17 06:47 mail.log.11.gz
-rw-r----- 1 root adm 3492 2012-06-10 06:47 mail.log.12.gz
-rw-r----- 1 root adm 143480 2012-06-04 06:25 mail.log.13.gz
-rw-r----- 1 root adm 2636 2012-07-01 06:47 mail.log.1.gz
-rw-r----- 1 root adm 149804 2012-07-02 06:25 mail.log.2.gz
-rw-r----- 1 root adm 250143 2012-06-28 06:25 mail.log.3.gz
-rw-r----- 1 root adm 159483 2012-07-01 06:25 mail.log.4.gz
-rw-r----- 1 root adm 217484 2012-06-30 06:25 mail.log.5.gz
-rw-r----- 1 root adm 220364 2012-06-27 06:26 mail.log.6.gz
-rw-r----- 1 root adm 155349 2012-06-25 06:26 mail.log.7.gz
-rw-r----- 1 root adm 3058 2012-06-24 06:47 mail.log.8.gz
-rw-r----- 1 root adm 221386 2012-06-23 06:25 mail.log.9.gz
How can I configure logrotate in order to really rotate mail.log weekly?
Thankyou

acid_kewpie 07-03-2012 03:42 AM

is there not something else rotating it already?

Reuti 07-04-2012 10:17 AM

Is there any size checked in the original definition which you abbreviated by the ellipses?


All times are GMT -5. The time now is 08:29 AM.