util: only consider regular files as logs
[unicorn.git] / examples / logrotate.conf
blob03fefc627302d15449e0b84d95a29e14c42d2c99
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...
11         daily
12         missingok
13         rotate 180
14         compress # must use with delaycompress below
15         dateext
17         # this is important if using "compress" since we need to call
18         # the "lastaction" script below before compressing:
19         delaycompress
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:
24         lastaction
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)"
28         endscript