The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 01:19 PM
Log rotation on HP-UX untamed HP-UX 3 10-01-2007 06:10 AM
What are tr.pid.rotation files? zackz UNIX for Advanced & Expert Users 3 01-23-2007 05:13 PM
logrotate.conf fredao UNIX for Advanced & Expert Users 10 12-19-2006 09:57 AM
Log Rotation Tool/Script yelalouf Shell Programming and Scripting 4 12-17-2003 09:27 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-31-2008
dvrmc dvrmc is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 2
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 08:23 AM.. Reason: incomplete description for someone to suggest a solution
  #2 (permalink)  
Old 02-01-2008
ynilesh's Avatar
ynilesh ynilesh is offline
Registered User
  
 

Join Date: Oct 2007
Location: Bangalore, India.
Posts: 222
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
}
  #3 (permalink)  
Old 02-01-2008
dvrmc dvrmc is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 2
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.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 06:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0