nginx logrotate

[root@nginx ~]# crontab -l

59 23 * /usr/sbin/logrotate -f /etc/logrotate.d/nginx

[root@nginx ~]# cat /etc/logrotate.d/nginx
/mnt/nginx/logs/*.log {
daily
rotate 30
missingok
notifempty
dateext
sharedscripts
postrotate
if [ -f /mnt/nginx/logs/nginx.pid ]; then
kill -USR1 cat /mnt/nginx/logs/nginx.pid
fi
endscript
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章