[Pkg-awstats-commits] [SCM] awstats Debian packaging branch, master, updated. debian/6.9.dfsg-1-141-ge0f8ec5

Sergey B Kirpichev skirpichev at gmail.com
Sat May 30 11:08:56 UTC 2009


The following commit has been merged in the master branch:
commit 32f7cfb0e7ce4af8277b44bd7eabf075015bdf4d
Author: Sergey B Kirpichev <skirpichev at gmail.com>
Date:   Fri May 22 13:41:01 2009 +0400

    Add script and crontab to generate daily static reports

diff --git a/debian/awstats.cron.d b/debian/awstats.cron.d
index 0fb8fe3..477f560 100644
--- a/debian/awstats.cron.d
+++ b/debian/awstats.cron.d
@@ -1 +1,4 @@
 */10 * * * * www-data [ -x /usr/lib/cgi-bin/awstats.pl ] && /usr/lib/cgi-bin/awstats.pl -config=awstats -update >/dev/null
+
+# Generate static reports:
+10 03 * * * awstats /usr/share/awstats/tools/buildstatic.sh
diff --git a/debian/awstats.install b/debian/awstats.install
index bb3ea86..c0ce213 100644
--- a/debian/awstats.install
+++ b/debian/awstats.install
@@ -7,5 +7,6 @@ wwwroot/cgi-bin/lib/*		usr/share/awstats/lib/
 wwwroot/cgi-bin/plugins/*.pm	usr/share/awstats/plugins/
 wwwroot/icon/*			usr/share/awstats/icon/
 tools/awstats_buildstaticpages.pl	usr/share/awstats/tools/
+debian/buildstatic.sh		usr/share/awstats/tools/
 
 debian/icons/firefox.png			usr/share/awstats/icon/browser/
diff --git a/debian/buildstatic.sh b/debian/buildstatic.sh
new file mode 100755
index 0000000..7dbf08a
--- /dev/null
+++ b/debian/buildstatic.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+##
+## buildstatic.sh, written by Sergey B Kirpichev <skirpichev at gmail.com> 
+##
+## Build all static html reports from AWStats data (Debian specific)
+##
+DEFAULT=/etc/default/awstats
+AWSTATS=/usr/lib/cgi-bin/awstats.pl
+BUILDSTATICPAGES=/usr/share/awstats/tools/awstats_buildstaticpages.pl
+
+[ -f $AWSTATS -a -f $BUILDSTATICPAGES ] || exit 1
+[ -r "$DEFAULT" ] && . "$DEFAULT"
+
+cd /etc/awstats
+
+for c in `ls -1 awstats.*.conf | sed 's/^awstats\.\(.*\)\.conf/\1/'`
+do
+  Y=`date +%Y`
+  m=`date +%m`
+  mkdir -p /var/cache/awstats/$c/$Y/$m/
+  AL=${AWSTATS_LANG:-en}
+  $BUILDSTATICPAGES \
+    -config=$c \
+	-year=$Y \
+	-month=$m \
+	-lang=$AL \
+	-staticlinksext=${AL}.html \
+	-dir=/var/cache/awstats/$c/$Y/$m/
+done >/dev/null

-- 
awstats Debian packaging



More information about the Pkg-awstats-commits mailing list