eldy / AWStats

AWStats Log Analyzer project (official sources)
https://www.awstats.org
369 stars 120 forks source link

Update old statistic files (e.g. MAP section) without a log file #144

Closed itzonban closed 4 years ago

itzonban commented 4 years ago

Hi,

I have to do some manual changes in old statistic files to comply with the new EU General Data Protection Regulation.

The documentation says that you should remove the MAP section after making changes and AWStats will rewrite the MAP section on the next update. But the logs are long gone, so I can't use the normal update procedure for that. Also I would need the automatic migration of the IP addresses for the visitors count, which is also covered by the normal update.

Is there any way to update an old statistic file without a log file?

Thanks and best regards Daniel

dariodsa commented 4 years ago

Yes, just pass empty log file to the statistics and Awstats will update the MAP section.

itzonban commented 4 years ago

Thanks for your response. I tried that, but this just updates the current statistic file (awstats092019.DOMAIN.txt), the old ones (e.g. awstats072019.DOMAIN.txt) won't be touched anymore...

dariodsa commented 4 years ago

Line to replace Line with $filedate replace into $filedate = sprintf( "%02i%04i", $MonthRequired, $YearRequired );

And run your script with following parameters perl awstats.pl -config={YOUR_CONFIG} -update -month=07 -year=2019 Your month has to have two digits, and when you are done you replace that line to the previous one.

itzonban commented 4 years ago

Thanks. I replaced the line and tested, but same result... no matter what month or year I use as parameter, only the current database file is updated...

dariodsa commented 4 years ago

That is strange. It works for me. Can you give me link to your awstats code, so that I can replicate your problem?

itzonban commented 4 years ago

I'm so sorry, I made a classic copy and paste error when switching the awstats.pl from the debian version to your current version :-/

Now it works as you described!! :) Thanks a lot for your help.