Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
/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