What is the best way to rotate NGINX log files ?

Igor Sysoev is at rambler-co.ru
Wed Dec 5 21:56:21 MSK 2007


On Wed, Dec 05, 2007 at 10:41:30AM -0800, Mansoor Peerbhoy wrote:

> I have a question. What's the best way to rotate the NGINX log file ? We run NGINX as a Mail Proxy, and the log file grows quite large because we don't restart it very frequently.
> 
> Are there any alternatives to simply killing the NGINX process, zipping up the error log, and then restarting NGINX ?

Of course!

mv error.log error.log.0
kill -USR1 `cat master.nginx.pid`
wait 1 second and do anything with log


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list