From e9b3bd9a71f16aab2ab98ad60b1637d1fb1b2a45 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Fri, 23 Jul 2010 13:41:02 +0200 Subject: [PATCH] logrotate: Rotate per-vhost logs by lighttpd. Also call update-stats to update awstats after rotating. --- etc/logrotate.d/data-www | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 etc/logrotate.d/data-www 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: -- 2.30.2