歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> nginx access log logrotate配置

nginx access log logrotate配置

日期:2017/3/1 15:29:31   编辑:關於Linux
nginx access log logrotate配置 /home/deployuser/deploy/nginx/temp/logs/home.access.log { size 100M rotate 100 nocompress daily missingok notifempty sharedscripts postrotate [ ! -f /home/deployuser/deploy/nginx/temp/logs/nginx.pid ] || kill -USR1 `cat /home/deployuser/deploy/nginx/temp/logs/nginx.pid` endscript } 保存在/etc/logrotate.d/home中,而logrotate是cronjob每天跑的任務。 postrotate部分是rotate之後通知nginx重新打開日志文件以免丟失日志。
Copyright © Linux教程網 All Rights Reserved