Membership Membership:
Latest New User Latest: vpros
Past 24 Hours Past 24 Hours: 0
Prev. 24 Hours Prev. 24 Hours: 0
User Count Overall: 137

People Online People Online:
Visitors Visitors: 19
Members Members: 0
Total Total: 19

NakedMCSE Computer Tech Support Forums

So you have passed all of the exams and you are now out in the real world of windows servers, linux servers and freebsd servers faced with a tech support problem you have never seen before...

Find free online tech support in the forums below, respecting that advice is free, but work beyond advice is not...

The General forum is provided for off topic discussion.

You need a user account to post - please Register or Login.

Online Tech Support Forums
 
  Forum  Open Source Tec...  NGINX Server  NGINX Log Rotation Script
Disabled Previous
 
Next Next
New Post 12/4/2009 1:04 PM
Informative
  Walker
119 posts
www.lairdscomputer.com
10th Level Poster


NGINX Log Rotation Script 

 Here is the log rotation script that I use with my NGINX install.  You need to add it as a file (say 'nginx') to the /etc/logrotate.d directory:

/var/log/nginx/*.log {
        notifempty
        daily
        rotate 3
        missingok
        compress
    postrotate
        /bin/kill `cat /usr/local/nginx/logs/nginx.pid 2> /dev/null` 2> /dev/null || true
        /usr/local/nginx/sbin/nginx &
    endscript
}

Obviously you will need to modify the locations of the pid file, the logs directory and the nginx executable as dictated by your environment.

Walker
www.lairdscomputer.com

 
Disabled Previous
 
Next Next
  Forum  Open Source Tec...  NGINX Server  NGINX Log Rotation Script
Send me One Million FREE Guaranteed Visitors