Skip to content

Instantly share code, notes, and snippets.

@demofly
Created July 3, 2014 12:27
Show Gist options
  • Save demofly/7295613af2c8dde1b0eb to your computer and use it in GitHub Desktop.
Save demofly/7295613af2c8dde1b0eb to your computer and use it in GitHub Desktop.
Debian Nginx logrotate
/var/log/nginx/*.log {
daily
dateext
dateformat .%Y-%m-%d
missingok
rotate 365
compress
delaycompress
notifempty
create 0640 www-data adm
sharedscripts
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi; \
endscript
postrotate
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment