AWStats: Taking Over Data from Other Profile

Submitted by h2b on
Problembeschreibung
System
AWStats
Version
7.0
Symptom
The AWStats profile has changed and older statistics shall be taken over.

When AWStats data shall be taken over from another, e.g. older, profile do the following.



First, ensure that during this procedure no unwanted updates of profiles take place by, say, removing all AWStats update commands from crontab.



Copy the old data files into the new profile data directory. The location of that directory is defined in the configuration file by the DirData directive, usually as /var/lib/awstats/<config>, where <config> denotes the profile name. The configuration file itself commonly is found in /etc/awstats as awstats.<config>.conf.



Rename the copied files according to the pattern

awstats<MMYYYY>.<config>.txt

Here, <MMYYYY> stands for a 6-digit code comprising 2 digits for the month and 4 digits for the year (this code should already be there in the old name and should not be altered) and <config> denotes the new profile name.

On overlapping (i.e., when there are multiple profile versions of a file, e. g. awstats032018.profile1.txt and awstats032018.profile2.txt) favour the older one provided that the corresponding newer data are still present in the current log file; the newer data then will be recovered at the next update.  If, however, the multiple data are from before the latest logrotate, the business is more complicated and not covered by this tutorial.

Then delete

dnscachelastupdate.<config>.hash

and call

/usr/lib/cgi-bin/awstats.pl -config=<config> -update

If everthing is okay, the AWStats update commands can be reactivated in crontab.

 

Bereich
Tags