Backing up AWStats

There are two sets of data which you need to backup; the configuration data and the historic data. The configuration file awstats.domainname.conf is stored in either the same directory as awstats.pl, /etc/awstats, /usr/local/etc/awstats or /etc while the historic data is stored in a database file in DirData (Default value “/var/lib/awstats”). There is one database file (e.g. awstatsMMYYYY.domainname.txt ) for each month. The historic data is summarised by analysing the data in the file pointed to by LogFile (Default value “/var/log/httpd/access_log”).

Simply copy the configuration and database files somewhere else using “cp -p”

Updating AWStats database

To update your statistics, run the command /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=domainname [-LogFile=xxx]

NOTE: When you access AWStats from your browser, you simply point to http://www.yourdomain.com/awstats/awstats.pl. This is because /awstats/ is defined as a Script Alias in /etc/httpd/conf/httpd.conf. You cannot access this alias from the command line, hence the long path.

Also, AWStats needs to analyse the data in chronological order. Thus, if you want to update the log to include data from previous dates, you must first move the later database files out of DirData

FAQ-COM360 : HOW CAN I PROCESS SEVERAL LOG FILES IN ONE RUN ?

PROBLEM:
How can I update my statistics for several log file, in one run ?
SOLUTION:
LogFile=”/usr/local/awstats/tools/logresolvemerge.pl access_log.* |”

Logresolvemerge is a tool provided with AWStats (in the tools directory) which merges several log files on the fly. It opens a pointer for each file and sends each record for processing a line at a time, starting with the oldest. Using such a tool as a pipe source for AWStats LogFile parameter is a very good solution because, it allows you to merge log files whatever their size with no memory use, minimal hard disk use (no temporary files built), and is fast. It prevents you from getting a “bad order” error if your log files are not correctly ordered, etc… This tool can also be used to process log files from load balanced systems (see FAQ-COM400)