Skip to content

Instantly share code, notes, and snippets.

@rubyonrailsworks
Last active October 12, 2015 19:38
Show Gist options
  • Save rubyonrailsworks/4077469 to your computer and use it in GitHub Desktop.
Save rubyonrailsworks/4077469 to your computer and use it in GitHub Desktop.
Logrotate
APPPATH/log/production.log {
compress
daily
rotate 30
create
missingok
compresscmd /usr/bin/zip
uncompresscmd /usr/bin/unzip
compressoptions -9
compressext .zip
postrotate
cd APPPATH/current && touch tmp/restart.txt
endscript
}
APPPATH/log/production.log {
daily
missingok
rotate 60
dateext
delaycompress
lastaction
pid=APPPATH/tmp/pids/unicorn.pid
test -s $pid && kill -USR1 "$(cat $pid)"
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment