#!/bin/sh
AWDIR="/web/awstats"
AWSTATS="$AWDIR/cgi-bin/awstats.pl"
REPORTS="alldomains allhosts lasthosts unknownip allemails lastemails allemailr lastemailr alllogins lastlogins allrobots lastrobots urldetail urlentry urlexit osdetail browserdetail unknownbrowser unknownos refererse refererpages keyphrases keywords errors404"
SITES="somedomain.com anotherdomain.com foobar.com"
INDEX_PAGE="$AWDIR/data/index.html"
custom_report() {
SITE=$1
REPORT=$2
$AWSTATS -config=$SITE -output=$REPORT -staticlinks > "$AWDIR/data/awstats.$SITE.$REPORT.html"
}
# At first parse all logs
for SITE in $SITES; do
$AWSTATS -config=$SITE
done
echo "" > $INDEX_PAGE
# Ok, now let's create million statistics pages
for SITE in $SITES; do
echo "<div><a href=\"$SITE.html\">$SITE</a></div>" >> $INDEX_PAGE
$AWSTATS -config=$SITE -output -staticlinks > "$AWDIR/data/$SITE.html"
for REPORT in $REPORTS; do
custom_report $SITE $REPORT
done
done
awstats batch statistic builder