3 # Called with no parameters, launch the daily awstats stats
4 # called with "all", launch all stats with all apache log files from /var/log/alternc/sites/
5 # called with a domain name, launch the stats for this domain from all apache log files
8 # AlternC system functions
11 # Regenerate the awstat etc cache files :
12 if [ -x ./awstats.cache.php ]
17 CACHEDIR="/var/cache/awstats" # Dans la sarge par defaut les données awstats sont stockées dans /var/lib/awstats ...
20 function searchdomain {
21 U_ID=$(mysql_query "SELECT uid FROM aws WHERE hostname='$1'" | grep -v "^uid")
22 U_LOGIN=$(mysql_query "SELECT login FROM membres WHERE uid='$U_ID'" |grep -v "^login")
23 DOM_DIR="$ALTERNC_LOGS/$U_ID-$U_LOGIN"
24 if [ -d "$DOM_DIR" ] ; then
25 echo $(find -P "$DOM_DIR" -mindepth 1 -maxdepth 2 -type f -iname "*.log*" -print0 | xargs -0)
33 echo -n "processing $DOM"
34 LOGAPACHE=$(searchdomain $DOM)
35 if [ -n "$LOGAPACHE" ] ; then
36 echo " (for access files in $LOGAPACHE )"
37 /usr/lib/cgi-bin/awstats.pl -config=$DOM -update -LogFile="/usr/lib/alternc/logresolvemerge.pl $LOGAPACHE* |"
39 echo "\n No log found"
49 echo "processing $DOM"
50 LOGAPACHE=$(searchdomain $DOM)
51 if [ -n "$LOGAPACHE" ] ; then
52 /usr/lib/cgi-bin/awstats.pl -config=$DOM -LogFile="/usr/lib/alternc/logresolvemerge.pl $LOGAPACHE | "
62 mysql_query "SELECT hostname FROM aws" |grep -v "^hostname" | dostat
66 mysql_query "SELECT hostname FROM aws" |grep -v "^hostname" | dostatgz