View Single Post
  #3  
Old 9th November 2010, 22:18
linus3x linus3x is offline
Junior Member
 
Join Date: Oct 2010
Posts: 16
Thanks: 2
Thanked 2 Times in 2 Posts
Default Update to the Script

OK - what we discovered on our system was: This script ran great the first time then after that, it never updated with new data. We kept seeing stats from the initial run of the script, but no updates.

After debugging a bit, I found that this script wasn't copying over the two awstats files once awstats.pl had finished building them.

I added the following line to the script and things are updating as they should:

Code:
[...]
#Needed to keep perl from spitting out warnings on my system
LANG="en_US.UTF-8"
CMD="$AWSTATS""  -config='""$CONFIG""' -lang=""$LANG"" -update"
$CMD

#NEW LINE
#Copy over the stat files that awstats just generated
cp -pu "$OLDDIR""awstats"*"$CONFIG"".txt" "$OLDDIR""dnscachelastupdate.""$CONFIG"".hash" "$DIR"

#Now that JAWStats is installed lets create that html file that ispconfig 3 will want to rename

cat > "$DIR""/awstats.""$CONFIG"".html" <<index-html-output
<html>
<head>
[...]
Make sure your OLDDIR option at the top of the script points to the folder where awstats.pl writes its output and you should be good to go. The default OLDDIR worked on our system.

This worked for us - your mileage may vary!
Reply With Quote