home / blog

Retrospective update of awstats

If you can need to update AWStats later with old records this can be done by changing the data files. I moved the dates back on the LastLine, LastTime and LastUpdate lines. This trickery is only required if you don’t have access to all the old records, if you do, you can just kill all the *.txt files and rebuild the whole lot.

BEGIN_GENERAL 8
LastLine 20110729003355 6314 1588376 10101920068921
FirstTime 20110701012016
LastTime 20110729002316
LastUpdate 20110729123300 6314 0 6261 0 53
TotalVisits 1901
TotalUnique 1172
MonthHostsKnown 931
MonthHostsUnknown 315
END_GENERAL

Then I ran awstats.pl manually with the -logfile option pointing at a file with the old records.

# combine/unzip old records
mv access.log.2011-07-2* /tmp
gunzip /tmp/access.log.*.gz
cat /tmp/access.log.* > /tmp/oldrecords.log

# update awstats
awstats.pl -config=example.com -logfile=/tmp/oldrecords.log
This entry was posted in geek and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.