运行logrotate后,Nginx将日志写入旧文件

时间:2016-05-16 02:36:19

标签: nginx logrotate

logrotate配置为:

cat /etc/logrotate.d/nginx:

/data/logs/nginx/*.log
{
daily
dateext
dateformat .%Y-%m-%d
rotate 30
missingok
create
notifempty
sharedscripts
postrotate
        [ ! -f /usr/local/nginx/logs/nginx.pid ] || kill -USR1 `cat /usr/local/nginx/logs/nginx.pid`
endscript
}

但是nginx将日志写入access.log.2016-05-15,而不是access.log

-rw-r--r-- 1 www  root    0 May 14 03:46 access.log
-rw-r--r-- 1 www  root  47M May 16 10:26 access.log.2016-05-15

我该如何解决?感谢。

0 个答案:

没有答案