Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

ls -l /var/log

cat /etc/logrotate.conf

ls -l /etc/logrotate.d

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
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
up vote 5 down vote accepted

Check that your logrotate is being run by cron.


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


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

I had a similar issue but crontab was working and for some of the log directories logrotate worked but for some it didn't. When I tried to run the logrotate manually, I got some error messages.

user@server:/var/log/apache2$ sudo /usr/sbin/logrotate -f /etc/logrotate.conf
error: error creating output file /var/log/apache2/access.log.1.gz: File exists
error: error creating output file /var/log/apache2/error.log.1.gz: File exists

All of the *.1.gz files had a size of 0. I manually deleted all of the files mentioned in the error message, ran sudo /usr/sbin/logrotate -f /etc/logrotate.conf again and it worked.

I just though I should share this alternate solution here as well, since this was the first search result that came up for me when I was searching for the problem but the suggested solution didn't work for me. Maybe this helps others as well who are in the same situation as I am.

share|improve this answer
thanks, had this issue, too. Deleted all the 1.gz files and it finally resumed working. what a horrible piece of code. – Florian Heigl Jan 23 at 20:05

OK I had a similar issue.

"logs aren't being rotated?" but running logrotate manually (or running the /etc/cron.daily and it rotates them just fine.

So it appears that cron just "isn't running" daily. Odd. So I looked in the logfile where cron outputs its data and saw " Authentication token is no longer valid; new one required" for fix to that particular issue, see here

share|improve this answer

Your Answer


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.