logrotate and cron.daily/weekly


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers logrotate and cron.daily/weekly
# 1  
Old 01-10-2012
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 rotating everynight rather than weekly.

I have added logrotate from cron.daily into cron.weekly but it's not had an affect, is there a step that I have missed ?

Here is my Tomcat one:
Code:
/var/log/tomcat6/catalina.out { 
copytruncate 
daily 
rotate 7 
compress 
missingok 
size 500M 
}

And my Apache one
Code:
/var/log/httpd/*log {
weekly
missingok
copytruncate
rotate 4
compress
notifempty
sharedscripts
postrotate
   /sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript
}

Does anyone have any ideas where I've went wrong ? It's driving me insane!!!

Cheers

- Jim
# 2  
Old 01-10-2012
Hi, have you checked for the contents of /etc/logrotate.conf and the contents of files in /etc/logrotate.d/ ?

It may be that some of those configuration files already contains specifications for the apache logs (tose in /var/log/httpd) that override the 'weekly' setting in your custom apache logrotate configuration file.

see ya
fra
# 3  
Old 01-10-2012
Hi frappa,

Yeah, the contents of /etc/logrotate.conf is as default and have never been changed. I've been through all the separate configuration files in /etc/logrotate.d and none of them have anything related to Apache contained in them.

I've tried it with and without the 'weekly' setting in the Apache config file as logrotate.conf has weekly as it's default setting but it hasn't made any difference!

Totally confused with this one. I also tried it with the logrotate config file for cron.daily inside cron.weekly too, but that made no difference either.

Any more ideas !?

- Jim
 
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

/etc/cron.daily script is not being executed

Hi All I have created a file in /etc/cron.daily on redhat linux 7.3 version host called applicationscript cat applictaionscript #!/bin/bash /prod/data/routine.sh cat /prod/data/routine.sh #!/bin/bash #details regular=/prod/data/jboss/logs backup=/prod/data/logs #echo "Moving logs"... (3 Replies)
Discussion started by: anil529
3 Replies

2. 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

3. Shell Programming and Scripting

How to disable cron emails, but only for logrotate only not for other logs?

Guys, is there a script or command? how to disable cron emails, but only for logrotate only not for other logs (3 Replies)
Discussion started by: kenshinhimura
3 Replies

4. UNIX for Dummies Questions & Answers

Help Creating Daily Cron Job

I need to create a cron job that will run daily to change permissions to a particular folder to 666 every 24hrs. I have no experience with crontab or cron jobs at all so if someone can guide me through this it would be a great help. The folder's example is 'www/test/htdocs' Also if you... (3 Replies)
Discussion started by: Xechno
3 Replies

5. UNIX for Advanced & Expert Users

cron/logrotate chicken and egg problem

I have run into a problem where about a dozen machines, all the same x86_64 2.6.12 GNU/Linux. For some reason these machines will fill up their /var partition (10G), because their logs never get rotated... Unfortunately, there is no error message from logrotate (would be in /var/log/messages) and... (8 Replies)
Discussion started by: jjinno
8 Replies

6. UNIX for Dummies Questions & Answers

cron.daily

At what time does cron.daily implement and how can i change this or set it etc? Thanks in advance. (5 Replies)
Discussion started by: ITFcraig
5 Replies

7. UNIX for Dummies Questions & Answers

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. ... (2 Replies)
Discussion started by: dvrmc
2 Replies
Login or Register to Ask a Question