User Tools

Site Tools


web_stats:awstats_on_eul0000794

example awstats setup

crontab tasks

30  7 * * * /home/www/sta/stats/www.example.com/scripts/syncmerge_example.sh
45  9 * * * /home/www/sta/stats/awstats/wwwroot/cgi-bin/awstats.pl -config=www.example.com -update

rsync script for www.example.com

#!/bin/sh
 
# for ((a=34; a > 1 ; a--))   # Loop to parse multiple logs
# do
 
RSYNC=/usr/bin/rsync
MERGELOG=/usr/local/bin/zmergelog
 
# LOGNAME=example.com-access_log.$a.gz
LOGNAME=example.com-access_log.1.gz
REMOTEPATH=/var/log/httpd
LOCALWEB3PATH=/home/www/sta/stats/example.com/logs/www3
LOCALWEB4PATH=/home/www/sta/stats/example.com/logs/www4
GLOBALPATH=/home/www/sta/stats/example.com/logs/global
 
$RSYNC -avz -e ssh server1:$REMOTEPATH/$LOGNAME $LOCALWEB3PATH/
$RSYNC -avz -e ssh server1:$REMOTEPATH/$LOGNAME $LOCALWEB4PATH/
 
# $MERGELOG $LOCALWEB3PATH/$LOGNAME $LOCALWEB4PATH/$LOGNAME > $GLOBALPATH/$LOGNAME
 
$MERGELOG $LOCALWEB3PATH/$LOGNAME $LOCALWEB4PATH/$LOGNAME > $GLOBALPATH/example.com-access_log.1
 
 
# echo $LOGNAME
 
# /home/www/sta/stats/awstats/wwwroot/cgi-bin/awstats.pl -config=example.com -update
 
# done                        # End of loop
/srv/wiki.niwos.com/data/pages/web_stats/awstats_on_eul0000794.txt · Last modified: 2009/08/15 19:42 (external edit)