cd /etc/logrotate.d/nginx
/usr/local/nginx/logs/*.log {
daily
missingok
rotate 180
compress
delaycompress
notifempty
sharedscripts
postrotate
   kill -USR1 `cat /usr/local/nginx/logs/nginx.pid`
endscript
}

手工轮转(可能由于日志文件权限关系,第一次需要手工轮转,否则可能不能自动轮转,待确认。)
logrotate -vf /etc/logrotate.d/nginx


有任何疑问请点击留言: 留言板
本文发布于http://wiki.too2.net,转载请联系本人。