Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two different (i386 v AMD) Debian boxes and have the same problem. logrotate won't rotate my logs automatically. It works fine when i force it manually like

/usr/sbin/logrotate -f /etc/logrotate.conf

but it's not okay for me.

Settings wasn't modified (at least i didn't modified them), the AMD box is a fresh install yet won't do it's job.

If you have noticed a similar problem, please help me.

Update (some server output):

logrotate -d http://pastebin.com/e6AshtGq

ls -l /var/log http://pastebin.com/Y2A4Li59

cat /etc/logrotate.conf http://pastebin.com/1h7Uwctr

ls -l /etc/logrotate.d http://pastebin.com/NvUAeszM

share|improve this question
    
Do you have any kind of error ? Verify that "include /etc/logrotate.d" is not commented. –  Torian Aug 17 '11 at 12:29
1  
How do you know it won't rotate your logs? Errors? Not happening after 30 days? Are these boxes up all the time? Is logrotate scheduled in cron? –  EightBitTony Aug 17 '11 at 12:31
    
I can verify that "include /etc/logrotate.d" is in place in both systems. No errors except some interesting entry in syslog, like ...rsyslogd was HUPed... not sure about this means anything. –  fabrik Aug 17 '11 at 12:32
    
@EightBitTony These are servers so they're up and running continuously. Settings are more or less are the defaults (logrotate config wasn't modified by me), only the usual stuff installed. logrotate is included in cron.daily yet rotating won't happen. –  fabrik Aug 17 '11 at 12:34
    
@Fabrik please add logrotate -d /etc/logrotate.conf output to the question –  EightBitTony Aug 17 '11 at 12:39

1 Answer 1

up vote 2 down vote accepted

Check that your logrotate is being run by cron.

Edit:

From the comment discussion - it appears that cron is not working correctly. I had a cronjob in my crontab without user but this only come to light when I restarted the cron daemon

My ubuntu and centos systems have an /etc/cron.daily/logrotate file the contents of which are

#!/bin/sh

test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf

My /etc/crontab has the following line to run the daily jobs

25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily 
share|improve this answer
    
This is totally looks like my config except the fact mine doesn't working :( –  fabrik Aug 18 '11 at 4:28
    
Is cron running check the output of ps -ef | grep cron| grep -v grep? Add an echo to the beginning of the /etc/cron.daily/logrotate echo "logrotate runing" >>/tmp/logrotate.out and see if it gets created. –  Iain Aug 18 '11 at 7:05
    
Looks like there's something went wrong with my crontab. cron is up and running but won't run the daily logrotate job. If i run /etc/cron.daily/logrotate manually it rotates my logs, /tmp/logrotate.out also written. –  fabrik Aug 18 '11 at 7:21
    
Don't forget the daily job won't run again till tomorrow! –  Iain Aug 18 '11 at 7:30
    
of course but yesterday i've modified /etc/cron.daily/logrotate so i've added a -f parameter to force rotating yet today morning my logs wasn't rotated. –  fabrik Aug 18 '11 at 7:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.