The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Disabling logrotate primal UNIX for Dummies Questions & Answers 2 04-14-2008 10:19 AM
Log rotation on HP-UX untamed HP-UX 3 10-01-2007 03:10 AM
What are tr.pid.rotation files? zackz UNIX for Advanced & Expert Users 3 01-23-2007 01:13 PM
logrotate.conf fredao UNIX for Advanced & Expert Users 10 12-19-2006 05:57 AM
Log Rotation Tool/Script yelalouf Shell Programming and Scripting 4 12-17-2003 05:27 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-31-2008
Registered User
 

Join Date: Jan 2008
Posts: 2
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
logrotate doesn't do daily rotation....help required

Hi,
I am using logrotate 3.7.4-13
-When i specify both "size" and "daily/weekly/monthly" , the logs are being rotated only based on size and the period is not being considered.
-When i just specify "daily/weekly/monthly" (with no size parameter), the logs are being rotated accordingly.

Would like to know what the problem is. If its a bug,Was it fixed in the latest rpms?

One more question - How does "daily rotation" work? Is the file rotated after 24hrs from its time of creation? or at 00:01 everyday??

Btw, I have a cronjob that runs every minute. My requirement is that, log files are to be rotated based on both size and period which ever comes first.

Last edited by dvrmc; 01-31-2008 at 04:23 AM. Reason: incomplete description for someone to suggest a solution
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-31-2008
Registered User
 

Join Date: Oct 2007
Posts: 23
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Log rotate includes all the files in /etc/logrotate.d/, hope you have kept you file inside this directory.

Is your configuration is like this ?
weekly Rotate logs weekly
rotate 4 Keep 4 weeks worth of backlogs
include /etc/logrotate.d/
/var/log/foo/access{
size=100k Rotate when it reaches a certain size
}
Reply With Quote
  #3 (permalink)  
Old 02-01-2008
Registered User
 

Join Date: Jan 2008
Posts: 2
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Hi,
Thanks for the reply.My file looks something like this

/var/log/sm/* {
olddir /var/log/stdir/sm
size 10k
daily
/* some scripts in postrotate */
}
/var/log/abs/* {
olddir /var/log/stdir/abs
size 1M
weeekly
/* some scripts in postrotate */
}

I put this file inside /etc/logrotate.d/
I have a cronjob running logrotate every minute.

-The problem is that when both size and daily/weekly/monthly/yearly are specified for a particular log, rotation takes place only according to the second parameter from the top in-order.

Ex:
CASE 1:
/var/log/sm/* {
olddir /var/log/stdir/sm
size 10k
daily
/* some scripts in postrotate */
}

In this case, logs are rotated only based on time....ie daily ...rotation based on size isn't working.

CASE 2:
/var/log/sm/* {
olddir /var/log/stdir/sm
daily
size 10k
/* some scripts in postrotate */
}
In this case, logs are rotated only based on size....ie 10k ...daily rotation isn't working.

CASE 3:
If only either size or daily/weekly/monthly/yearly is present, the logs are rotated accordingly.The problem arises only when both are used in conjunction.

I have tried rpms 3.7.4-13 and 3.7.4-14 for fc6 . Its the same with both of them. Is this a bug yet to be solved?If its solved, plz let me know the updated rpm for fc6.

Regards,
Chowdary.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101