2 Answers
工具默认用系统自带logrotate切割日志,
编辑/etc/logrotate.d/nginx,保存内容如下:
编辑/etc/logrotate.d/nginx,保存内容如下:
/data/wwwlogs/*nginx.log {
daily
rotate 5
missingok
dateext
compress
notifempty
sharedscripts
postrotate
[ -e /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
endscript
}
Please login or Register to submit your answer