View Single Post
Old 9th November 2010, 23:18
linus3x linus3x is offline
Junior Member
Join Date: Oct 2010
Posts: 16
Thanks: 2
Thanked 4 Times in 3 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 had finished building them.

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

#Needed to keep perl from spitting out warnings on my system
CMD="$AWSTATS""  -config='""$CONFIG""' -lang=""$LANG"" -update"

#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
Make sure your OLDDIR option at the top of the script points to the folder where 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