If you do not have reason to believe it will cause significant performance issues, use that method.Before updating an AWStats profile, you should merge the uploaded logs to one file named and reset the last update timestamp for a profile on the AWStats server. Although the "Logs processed" line is displayed, AWStats has not processed the stats information.
So, if the missing dates are in June, and it is currently August, you’ll need to remove the data files for June, July, and August (they look like this where MM is the two digit month and YYYY is the four digit year) to a temporary directory so they are out of the way.
First step is to get all of the logs for each domain for the month.
Now, a quick one-liner to grab all of the files within a certain date range and put their content in a new file.
We’ll use the find command to find the correct files.
This will work out to about 30 or 31 files (if the month is already past), or however many days have past in the current month.
For me, each domain archives the days logs in the following format where the X is a sequential number.
This means I’ll have to do this process about 140 times. AWStats can’t run the update on older months if there are more recent months located in the data directory.
So we’ll need to move the more recent month’s stats to a temporary location out of the way.
I have checked the error logs, there is not a problem with my script or with AWStats timing out. For the record, this script is designed to purge the old data, update a blacklist of referrers to block spam, and then recompile the stats data from the log files.