I am using the access log import method for piwik analytics (rather than JS tracking) and I would like it to rotate the access log file (truncate it to 0 size, gzip the original and store it at some specified path) once the import has finished.
Is there a way to do it as part of the import process (some setting)? I could of course use a logrotate script, but I think there is going to be a time lag between the end of import process and the log file rotation, so some records (which will have been stored in the meantime) will be removed without having been imported.
I know AWStats has this option and has been rather useful (to us, at least).
Can you please advise me on it? I am on version 1.12.
Note: I am now running Piwik 2.0.3 on CentOS 6.5 (on a professionally hosted virtual machine, hosting a website under NGINX / mysql / php-fpm).
The above approach (i.e. logrorate with prerotate script) seems to be working well, except that in some cases piwik does not seem to complete the analysis. Here is a monthly chart:
You can see that on Feb 6 and Feb 9, for some reason, something went wrong and stats were not produced. I have been unable to relate these issues to any specific events. Indeed, reports for these dates are empty.
Question 1: Could you suggest some reason why this may have happened?
Additionally, I am puzzled by the analysis produced for Jan 27 and Jan 29, where the Dashboard graph shows 0 unique visitors, while, in fact, there have been recorded (by piwik) unique visitors. For example, the “Visits by Server Time” table reveals that there were 15089 unique visitors on Jan 27.
Question 2: Why the unique visitors graph does not display the correct numbers for the afore mentioned dates?
To make things clearer, please let me rephrase Question 2: Can you please provide directions on how I can update the graph so as to display correctly the No. of unique visitors for the dates mentioned?