nginx 日志轮转

[root@nginx1 ~]# vim /etc/logrotate.d/nginx 
/usr/local/nginx/log/*.log {
        daily
        dateext
        missingok
        rotate 90
        compress
        notifempty
        create 640 nginx root
        sharedscripts
        olddir /usr/local/nginx/log/archive
        postrotate
                [ -f /var/run/nginx.pid ] && kill -HUP `cat /var/run/nginx.pid`
        endscript
}
logrotate -vf /etc/logrotate.d/nginx  强制轮转
posted @ 2018-05-23 15:46  日出东海,我心向西  阅读(1065)  评论(0编辑  收藏  举报