logrotate doesn't do daily rotation....help required


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers logrotate doesn't do daily rotation....help required
# 1  
Old 01-31-2008
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  
Old 02-01-2008
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  
Old 02-01-2008
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.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Logrotate with catalina.out "daily compressed file is overwriting the logs"

Hi Everyone, We are trying to do a logrotate for "catalina.out" daily, So have used the "copytruncate" option in the logrotate configuration but ended up seeing there was a 0kb file touched with "catalina.out" and the other file with the current date(compressed) file created and seems the log is... (2 Replies)
Discussion started by: thiyagoo
2 Replies

2. SuSE

Find command doesn't pipe the output as required.

Hi, I am using below code snippet to echo/display the files found (matching a pattern from searchstring.out file) and the corresponding owner. while read j do echo "Pattern to search is:- $j" find / -name "*$j*" |\ while read k do echo "File found is:- $k" owner=$(ls... (9 Replies)
Discussion started by: Vipin Batra
9 Replies

3. Solaris

Log rotation

Hi All! I seem to have a problem with log rotation, unless I am doing something wrong, I have type the following command for testing purposes to see if the -s option works but he did not: logadm -w /var/adm/messages -C 8 -c -s 512k -t '/var/adm/messages.$n' -z 1 the file is now at this... (7 Replies)
Discussion started by: fretagi
7 Replies

4. AIX

Logrotate - /etc/logrotate.conf does't exist

Hi Admins. I have installed logrotate rpm on Aix 6.1. After the installation of rpm, I don't find /etc/logrotate.conf file and /etc/logrotate.d dir . The config file is located in /opt/freeware/etc/logrotate.conf. When I ran logrotate -v /opt/freeware/etc/logrotate.conf I get below... (2 Replies)
Discussion started by: snchaudhari2
2 Replies

5. Shell Programming and Scripting

Logrotate - I am not able to rotate files using logrotate

I have written script which is working in Home directory perfectly and also compressing log files and rotating correctly. But, when i try to run script for /var/log/ i am able to get compressed log files but not able to get rotation of compressed log files. Please suggest. I am using below command... (5 Replies)
Discussion started by: VSom007
5 Replies

6. UNIX for Dummies Questions & Answers

Log Rotation

Hi Guys, Good morning, I just want to know and collect ideas on this one. Regarding rotation of logs as I've observed it's not consistently functioning. I have a server with 8 Partitions, each partition has a dedicated directory for the logs that is needed and I set it every 5mins (300secs) the... (1 Reply)
Discussion started by: rymnd_12345
1 Replies

7. Red Hat

check ip rotation

Hi all, I configured ip rotation on exim mail server by modifying the /etc/exim.conf file. I want to check whether the ip address rotating or not. Can any body show me how can i find out is it rotating or not. Thanks, (1 Reply)
Discussion started by: mastansaheb
1 Replies

8. UNIX for Dummies Questions & Answers

logrotate and cron.daily/weekly

Hi guys, I've got two separate logrotates I'd like to run, one for Tomcat and one for Apache, but I'd like to run the Tomcat one daily and the Apache one weekly. Now, the logrotate itself is working fine, but although I have 'daily' in Tomcat, and 'weekly' in the Apache one, the latter is... (2 Replies)
Discussion started by: jimbob01
2 Replies

9. UNIX for Advanced & Expert Users

logrotate with /etc/logrotate.conf file

Hi there, I want to rotate the logfiles which are located in /var/log/jboss/tomcat* so I have created a file named as 'tomat' in /etc/logrotate.d/tomcat with the following content. # cat /etc/logrotate.d/tomcat /var/log/jboss/tomcat_access_log*.log { daily nocreate ... (2 Replies)
Discussion started by: skmdu
2 Replies

10. Shell Programming and Scripting

Getting required fields from a test file in required fromat in unix

My data is something like shown below. date1 date2 aaa bbbb ccccc date3 date4 dddd eeeeeee ffffffffff ggggg hh I want the output like this date1date2 aaa eeeeee I serached in the forum but didn't find the exact matching solution. Please help. (7 Replies)
Discussion started by: rdhanek
7 Replies
Login or Register to Ask a Question