1 # example logrotate config file, I usually keep this in
2 # /etc/logrotate.d/unicorn_app on my Debian systems
4 # See the logrotate(8) manpage for more information:
5 # http://linux.die.net/man/8/logrotate
7 # Modify the following glob to match the logfiles your app writes to:
8 /var/log/unicorn_app/*.log {
9 # this first block is mostly just personal preference, though
10 # I wish logrotate offered an "hourly" option...
14 compress # must use with delaycompress below
17 # this is important if using "compress" since we need to call
18 # the "lastaction" script below before compressing:
21 # note the lack of the evil "copytruncate" option in this
22 # config. Unicorn supports the USR1 signal and we send it
23 # as our "lastaction" action:
25 # assuming your pid file is in /var/run/unicorn_app/pid
26 pid=/var/run/unicorn_app/pid
27 test -s $pid && kill -USR1 "$(cat $pid)"