View Single Post
  #2  
Old 10th August 2012, 00:37
Justin Albstmeijer Justin Albstmeijer is offline
Member
 
Join Date: Dec 2007
Posts: 74
Thanks: 1
Thanked 5 Times in 5 Posts
Default

Eventually I found the stats of the previous months should each reside in a separate folder.

For example, the index of July should be:

/var/www/website.ext/web/stats/2012-7/awsindex.html

so to import the previous months, based on existing awstats data, I did:

year=2012
site=website.ext

for month in 1 2 3 4 5 6 7; do
mkdir -p /var/www/$site/web/stats/$year-$month
awstats_buildstaticpages.pl -year=$year -month=$month -config=$site -awstatsprog=/var/www/awstats/awstats.pl -dir=/var/www/$site/web/stats/$year-$month
cp /var/www/$site/web/stats/$year-$month/awstats.$site.html /var/www/$site/web/stats/$year-$month/awsindex.html
done
Reply With Quote