Skip to content

Instantly share code, notes, and snippets.

@vdv
Created December 22, 2014 18:42
Show Gist options
  • Save vdv/93996936dbfc1e2d669f to your computer and use it in GitHub Desktop.
Save vdv/93996936dbfc1e2d669f to your computer and use it in GitHub Desktop.
logrotate rails logs
/home/deployer/site/shared/log/nginx-*.log {
weekly
missingok
rotate 10
compress
delaycompress
notifempty
create 0640 deployer deployer
postrotate
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
endscript
}
/home/deployer/site/shared/log/production.log {
weekly
missingok
rotate 30
compress
delaycompress
notifempty
create 0640 deployer deployer
postrotate
pid=/home/deployer/site/shared/tmp/pids/unicorn.pid
[ ! -f $pid ] || kill -USR1 `cat $pid`
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment