From: Matthijs Kooijman Date: Fri, 23 Jul 2010 11:41:02 +0000 (+0200) Subject: logrotate: Rotate per-vhost logs by lighttpd. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=e9b3bd9a71f16aab2ab98ad60b1637d1fb1b2a45;p=matthijs%2Fservers%2Fdrsnuggles.git logrotate: Rotate per-vhost logs by lighttpd. Also call update-stats to update awstats after rotating. --- diff --git a/etc/logrotate.d/data-www b/etc/logrotate.d/data-www new file mode 100644 index 0000000..931551b --- /dev/null +++ b/etc/logrotate.d/data-www @@ -0,0 +1,27 @@ +/data/www/*/logs/*/*.log { + # Rotate daily + daily + # Keep them all + rotate 9999 + # Compress files after rotation + compress + # But only a day after actually rotating them for the first + # time. See http://bugs.gentoo.org/106651 + delaycompress + notifempty + # Use the current date as the extension for rotating + dateext + # lighttpd will create new files itself + nocreate + # Call this script once after rotating all files + sharedscripts + postrotate + # Let lighttpd reopen its config files (HUP might be better, + # but we'd have to look in pidfiles etc.) + invoke-rc.d lighttpd reload > /dev/null; + # Do stats analysis on the rotated files + /usr/local/bin/update-stats --after-logrotate; #> /dev/null; + endscript +} + +# vim: set ts=8 sw=8 noexpandtab autoindent: