Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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
Message 1:
From  Wed May  2 03:01:02 2012
Date: Wed, 2 May 2012 03:01:02 +0400
From: (Cron Daemon)
Subject: Cron <root@server> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
Content-Type: text/plain; charset=ANSI_X3.4-1968
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <LOGNAME=root>

head: cannot open `status' for reading: No such file or directory
sed: can't read status: No such file or directory

and how do I fix it?

share|improve this question
up vote 0 down vote accepted

You can refer to the following blog link for a detailed discussion:

A quick and dirty trick would be to touch or create an empty file /var/lib/logrotate/status on your server.

Just a brief background:

logrotate is a utility which can rotate log files and archive them in a specified location.

cron is a service which can be used to schedule to run/automate specific tasks.

Now, apparently, since cron on the server is scheduled to run the logrotate script daily, which in turn expects the status file to be present (which doesn't exist), your server is throwing these error messages.

Hope it helps.

share|improve this answer
Thanks for the answer. This was similar to the other one but clearer. – bran May 6 '12 at 8:31

I think if you have a look at /etc/cron.daily/logrotate - you will find that the script is checking for the existence of (and capability to write to): /var/lib/logrotate/status

In my /etc/cron.daily/logrotate script, there is a line that precedes the head command that will first test for the existence of, OR create (with touch) the "status" file: test -e status || touch status head -1 status > status.clean

Probably yours is not able to write the "status" file to "/var/lib/logrotate/" with the touch command? I would cd into /var/lib/logrotate//logrotate and see if I could manually create the "status" file(assuming it doesn't exist there already) with the command: touch status . Maybe there's no disk space left for that directory? Check with df -h /var/lib/logrotate/ , or maybe it's set to be immutable (dunno why this would be).

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.