Added a sample script for logfile rotation.
authorFredrik Tolf <fredrik@dolda2000.com>
Tue, 15 Feb 2011 21:58:48 +0000 (22:58 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Tue, 15 Feb 2011 21:58:48 +0000 (22:58 +0100)
etc/debian/cron.weekly-ashd [new file with mode: 0755]

diff --git a/etc/debian/cron.weekly-ashd b/etc/debian/cron.weekly-ashd
new file mode 100755 (executable)
index 0000000..e19a63e
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+LOGDIR=/var/log/http
+CYCLE=7
+
+cd "$LOGDIR"
+
+for log in *.log; do
+    if [ -e "$log" ]; then
+       pid="$(accesslog -P "$log" 2>/dev/null)"
+       savelog -qpt -c "$CYCLE" "$log"
+       if [ -n "$pid" ] && [ "$pid" -ne 0 ]; then kill -HUP "$pid"; fi
+    fi
+done