![]() ![]() So the first problem is how to get the correct file name without having to look in each file to see if it has the right day? Fortunately for me, nothing touches these files after they are created, so their mtime (the time stamp of when they were last modified) is intact and usable. For me, each domain archives the days logs in the following format -access_log-X.gz and -error_log-X.gz where the X is a sequential number. 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. Get the Apache logs for the month.įirst step is to get all of the logs for each domain for the month. 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. So we’ll need to move the more recent month’s stats to a temporary location out of the way. Move the data files of newer monthsĪWStats can’t run the update on older months if there are more recent months located in the data directory. Looks like I need to write a script… Step 1. This means I’ll have to do this process about 140 times. We have our Apache logs rotate each day for each domain on the server (or sub-directory that is calculated separately). Here’s how I have Apache set up, and the process I went through to get the missing days back into AWStats. Replace the AWStats data files for the following months (undo step 1).Īgain, depending on how you have Apache logs set up, this can be an intensive process.Run the AWStats update tool, using AWStat’s logresolvemerge tool and other changed paramaters, to re-create the AWStats data file for that month.Copy the Apache logs with all of the stats for the month with the missing days to a temporary directory.Move the AWStats data files for months newer to a temporary directory.The AWStats Documentation (see FAQ-COM350 and FAQ-COM360) has some basic steps to fix the issue, outlined below: Unfortunately, it’s a bit labor intensive, and depends on how you rotate your apache logs (if at all, which you should). I didn’t notice this until several days later, leading to a large gap in the stats for April. Cron is the absolutely necessary tool for getting the server to run things on a timed schedule. ![]() I reinstalled some software on our AWStats machine, and forgot to reinstall cron. Usually, as in my case, it’s because I messed up. Sometimes AWStats will miss some days in calculating stats for your site, and that leaves a big hole in your records.
0 Comments
Leave a Reply. |