Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 a site that keeps going down at midnight, and i think it may be due to my server logs being rotated. how do i find out when that occurs each day? any help would be greatly appreciated.

it is linux OS.

share|improve this question
What OS?....... – Fergus Jan 11 '11 at 2:29
linux OS sorry! – HollerTrain Jan 11 '11 at 2:32
Any distribution in particular? – Nupraptor Jan 11 '11 at 2:39
Ahh. That looks like the kernel for openvz for rhel4/centos4. – mattdm Jan 11 '11 at 4:09
So this is the same server as in I assume? Seems unlikely that your logrotation would happen at midnight and take down the server but certainly worth checking I guess. – Phil Hollenback Jan 11 '11 at 4:10
up vote 3 down vote accepted

Scripts executed daily usually are in the /etc/cron.daily/ directory. You can also check scripts in /etc/cron.d/ and the file /etc/crontab.

Log rotation rules are usually at /etc/logrotate.d/

share|improve this answer

So, regardless of Linux distribution or application, it's generally easy to see when log files are rotated by their nature. Check the timestamps on the first and last entries in each log file, and there you go.

share|improve this answer

You can see when a process was started. So you can see if your server was restarted at midnight:

ps -eo pid,stime,cmd

For the log files, first check that they are closed, then check the mtime and ctime with:

stat filename

For the old file it is interested the Modify time to know when it was closed. This should be close to the Change time of the new log file that is still open.

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.