Import des anciens logs d'awstats ?

1 réponse
Avatar
JUPIN Alain
Bonjour,

Étant en phase de migration d'un serveur LAMP vers un autre (plus récent
et puissant), je cherche a migrer les données awstats. En effet sur
l'ancien serveur, dans /var/lib/awstats, j'ai tout un tas de fichier de
la forme awstatsMMYYYY.domain.tld.txt
Je les ai copié dans le même répertoire sur le nouveau serveur, mais (je
m'y attendais un peu) les données non pas été prises en compte par
awstat (du nouveau serveur).

Comment faire en sorte que Awstats prenne en compte ces anciens fichiers ?
J'ai vu pas mal de choses en réanalysant les anciens logs apache, mais
vu que le serveur est ancien (2011), je ne dispose plus de tous les logs
apache (seulement la dernière année) hors je souhaite conserver TOUT
l'historique awstats.

Merci pour votre aide

--
Alain JUPIN

1 réponse

Avatar
Alexandre Hoïde
On Fri, May 17, 2019 at 01:35:11PM +0200, JUPIN Alain wrote:
Comment faire en sorte que Awstats prenne en compte ces anciens fichiers ?

Bonjour,
Tiré de https://awstats.sourceforge.io/docs/awstats_faq.html#OLDLOG
FAQ-COM350 : HOW CAN I PROCESS AN OLD LOG FILE ?
PROBLEM:
I want to process an old log file to include its data in my AWStats reports.
SOLUTION:
You must change your LogFile parameter to point to the old log file and run the update (or use the -LogFile option on command line to overwrite LogFile parameter). The update process can only accept files in chronological order for a particular month, so if you have already processed a recent file and forgot to run update on a log file that contains older data, you must reset all of your statistics (see FAQ-COM500) and restart all of the update processes for all past log files and in chronological order.
However, there is a "tip" that allows you to rebuild only the month were you missed data:
Imagine we are on 5th of July 2003, all your statistics are up to date except for the 10th of April 2003 (you forgot to run the update process for this day, so there is no visit for this day). You can :
- Reset the statistics for April only (this means remove the file awstats042003.[config.]txt as explained in FAQ-COM500),
- Move the statistics history files for the month after April (file awstats052003.[config.]txt, awstats062003.[config.]txt,...) into a temp directory (so that it is no longer in the DirData directory; as if they were deleted).
- Run the update process on all log files for April (in chronological order). AWStats does not complain about "too old record" because there is no history files in DirData directory that contains compiled data more recent than records into log you process.
- Moved back the month history files you saved into your DirData directory.
Your statistics are up to date and the missing days are no longer missing.
… si ça peut aider. Bonne chance !
--
 ___________________
| $ post_tenebras ↲ | waouh!
| GNU         /    |    
|          -- * --  |     o
| $ who ↲    /     |_-- ~_|
| Alexandre Hoïde   |  _/| |
 -------------------