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 am trying to rotate nginx log using Logrotate.It's appending log to same file (error.log and access.log) but not rotating on daily basis. Below are the configuration file for the same. Please let me know if i am missing anything.

/var/log/nginx/*.log {
        rotate 52
        create 640 nginx adm
                [ -f /var/run/ ] && kill -USR1 `cat /var/run/`

$ more /etc/cron.daily/logrotate


/usr/sbin/logrotate  /etc/logrotate.conf >/dev/null 2>&1
if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
exit 0

SELinux status

# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted
share|improve this question

Are you sure you are not missing "`" 's surrounding the cat command ? According to:

Also could you check out /var/log/audit/audit.log for something about "nginx", Auditing System auditd is started by default. If the auditd daemon is not running, then messages are written to /var/log/messages so check there too.

Also is check the path to the if its correct too. You might have nginx in /usr/local/nginx or in /opt or something like that.

share|improve this answer

Check your disk space also. I have run into a situation at times when log rotation on a VM was not working, and the only error I saw in the /var/log/messages was "ALERT exited normally with [1]". The problem was I had very little disk space remaining and it probably was not able to compress my log files. I cleaned up and it started working again.

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.