diff options
Diffstat (limited to 'examples/logrotate.conf')
-rw-r--r-- | examples/logrotate.conf | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/examples/logrotate.conf b/examples/logrotate.conf new file mode 100644 index 0000000..ebc92a5 --- /dev/null +++ b/examples/logrotate.conf @@ -0,0 +1,32 @@ +# To the extent possible under law, Eric Wong has waived all copyright and +# related or neighboring rights to this examples +# +# example logrotate config file, I usually keep this in +# /etc/logrotate.d/yahns_app on my Debian systems +# +# See the logrotate(8) manpage for more information: +# http://linux.die.net/man/8/logrotate + +# Modify the following glob to match the logfiles your app writes to: +/var/log/yahns_app/*.log { + # this first block is mostly just personal preference, though + # I wish logrotate offered an "hourly" option... + daily + missingok + rotate 180 + compress # must use with delaycompress below + 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. yahns supports the USR1 signal and we send it + # as our "lastaction" action: + lastaction + # assuming your pid file is in /var/run/yahns_app/pid + pid=/var/run/yahns_app/pid + test -s $pid && kill -USR1 "$(cat $pid)" + endscript +} |