-
-
Save ranguard/5fd3c323a6bf2262945d to your computer and use it in GitHub Desktop.
This file contains 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
/var/log/psgi/foxtons-website/*.log { | |
daily | |
rotate 52 | |
missingok | |
delaycompress | |
notifempty | |
create 640 web web | |
sharedscripts | |
postrotate | |
LOGDIR="/var/log/psgi/foxtons-website" | |
if [ -f /tmp/starman_foxtons-website.pid ]; then \ | |
if [ -x /usr/sbin/invoke-rc.d ]; then \ | |
invoke-rc.d starman_foxtons-website restart > /dev/null 2>&1; \ | |
else \ | |
/etc/init.d/starman_foxtons-website restart > /dev/null 2>&1; \ | |
fi; \ | |
fi; | |
HOSTNAME=`/bin/hostname` | |
EXT=`/bin/date -d yesterday +%F` | |
for f in access.log error.log; | |
do | |
if [ -f $LOGDIR/$f.1 ]; then | |
mv $LOGDIR/$f.1 $LOGDIR/$f-foxtons-website.$HOSTNAME.$EXT; | |
/usr/bin/nice -20 /bin/bzip2 -f $LOGDIR/$f-foxtons-website.$HOSTNAME.$EXT | |
chown web.web $LOGDIR/$f-foxtons-website.$HOSTNAME.$EXT.bz2 | |
chmod 666 $LOGDIR/$f-foxtons-website.$HOSTNAME.$EXT.bz2 | |
fi; | |
done | |
endscript | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment