Created
December 15, 2011 07:03
-
-
Save pshima/1480137 to your computer and use it in GitHub Desktop.
Unicorn logrotate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/path/to/unicorn/log/unicorn.stderr.log | |
/path/to/production/log/production.log | |
{ | |
daily | |
missingok | |
rotate 180 | |
compress | |
dateext | |
# this is important if using "compress" since we need to call | |
# the "lastaction" script below before compressing: | |
delaycompress | |
# note the lack of the evil "copytruncate" option in this | |
# config. Unicorn supports the USR1 signal and we send it | |
# as our "lastaction" action: | |
lastaction | |
pid=/path/to/pid/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