nginx logrotate
-
/etc/logrotate.d/nginx
cat > /etc/logrotate.d/nginx <<EOF /var/log/nginx/*.log { daily missingok rotate 30 compress notifempty dateext sharedscripts postrotate [ -f /var/run/nginx.pid ] && kill -USR1 \`cat /var/run/nginx.pid\` endscript } EOF
-
执行logrotate
logrotate -f /etc/logrotate.d/nginx