Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.
Message 1:
From root@server.myserver.net  Wed May  2 03:01:02 2012
Date: Wed, 2 May 2012 03:01:02 +0400
From: root@server.myserver.net (Cron Daemon)
To: root@server.myserver.net
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>

/etc/cron.daily/logrotate:
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
add comment

2 Answers 2

up vote 0 down vote accepted

You can refer to the following blog link for a detailed discussion: http://teklimbu.wordpress.com/2007/10/16/managing-your-linuxunix-log-files-using-logrotate/

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
add comment

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
add comment

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.