LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-03-2012, 02:54 AM   #1
circus78
Member
 
Registered: Dec 2011
Posts: 273

Rep: Reputation: Disabled
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
 
Old 07-03-2012, 03:42 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
is there not something else rotating it already?
 
Old 07-04-2012, 10:17 AM   #3
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
Is there any size checked in the original definition which you abbreviated by the ellipses?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] logrotate cron.weekly digitaldude Linux - Server 3 10-27-2011 06:17 AM
Logrotate rotating daily when should rotate weekly nanda_martins Linux - Server 14 03-29-2010 12:24 PM
Apache crash on cron->logrotate (weekly) pezzer55 Linux - Software 7 09-30-2008 07:58 PM
apache request_log rotation - logrotate noir911 Linux - Server 2 09-10-2008 10:29 PM
Log Rotation using Logrotate keysorsoze Linux - General 4 04-13-2007 02:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration