Skip to content

Instantly share code, notes, and snippets.

@lesstif
Last active August 6, 2019 07:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesstif/317a11a9f9de5db38d36e8fd78c72b2e to your computer and use it in GitHub Desktop.
Save lesstif/317a11a9f9de5db38d36e8fd78c72b2e to your computer and use it in GitHub Desktop.
log roate script for nginx(/etc/logrotate.d/nginx)
/var/log/nginx/*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 640 nginx adm
sharedscripts
postrotate
if [ -f /var/run/nginx.pid ]; then
kill -USR1 `cat /var/run/nginx.pid`
fi
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment