小浣熊hhuc 发表于 2014-03-23 09:47

logrotate管理分割nginx日志无效

本帖最后由 小浣熊hhuc 于 2014-03-23 09:47 编辑

服务器想使用logrotate管理分割nginx日志,但是不知道为什么好几天了一直没有效果。如果手动执行logrotate强制rotate日志,能够成功分隔日志。

系统环境是centos 6.4。

下面是配置:# cat /etc/logrotate.d
/usr/local/nginx/logs/*.log {
daily
rotate 15
missingok
dateext
sharedscripts
postrotate
    if [ -f /usr/local/nginx/logs/nginx.pid ]; then
      kill -USR1 `cat /usr/local/nginx/logs/nginx.pid`
    fi
endscript
}执行sudo logrotate-dv /etc/logrotate.d/nginx的时候显示log does not need rotating
页: [1]
查看完整版本: logrotate管理分割nginx日志无效