Process archive every hour?


(jasonaward) #1

I think I may be misunderstanding something regarding the archive process.

In short, I’d like to be able to process statistics on an hourly basis. As such, I have the following in my crontab file:

5 *  * * *     apache    /data/var/www/stats/public_html/piwik/misc/cron/archive.sh

In my config.ini.php, I’ve added the following:

[General]
time_before_today_archive_considered_outdated = 60
enable_browser_archiving_triggering = false
default_day = today

I would expect that every hour the statistics would be updated. But this doesn’t appear to be happening. I can also fire the archive process from the command prompt, and it outputs the XML, but the XML is the same every time I call the script.

Am I possibly misunderstanding something? Any information would be greatly appreciated!

Thanks for a great project!!! style_emoticons/<#EMO_DIR#>/smile.gif


(Matthieu Aubry) #2

60 means 1min here, you would want to write 3600

the data should be updated, in the output of archive.sh, every time_before_today_archive_considered_outdated seconds. Does it work?


(jasonaward) #3

[quote=matthieu @ Mar 31 2010, 02:09 PM]60 means 1min here, you would want to write 3600

the data should be updated, in the output of archive.sh, every time_before_today_archive_considered_outdated seconds. Does it work?[/quote]

It does not appear to work (update stats) — even running with time_before_today_archive_considered_outdated = 0, it shows the same output as displayed by the UI prior to running the command, meaning it doesn’t appear to actually do anything but display the previously calculated statistics. Running archive.sh multiple times also outputs the same XML.

Any thoughts about what might be wrong would be appreciated! Thanks. style_emoticons/<#EMO_DIR#>/smile.gif


(jasonaward) #4

As a side note, if I add this to config.ini.php, it does actually result in the archive process working correctly:

[Debug]
always_archive_data_day = 1
always_archive_data_period = 1

Thanks!


(Matthieu Aubry) #5

Are you able to try the new Piwik from SVN?
you can download at: http://dev.piwik.org/trac/changeset/2078/t…&format=zip
This bug might be fixed with the new timezone implementation. I would be interested to know if it now works for you. thx


(edvsb) #6

I have the same problem with the last version dev.piwik.org/trac/browser/trunk?rev=2081

The stats for today are not produced.

Output from archive.sh

    <result date="2010-04-10">1415</result>
    <result date="2010-04-11">11156</result>
    <result date="2010-04-12" />

I used different time zones. UTC, UTC+1, UTC+2 oder “Europe/Berlin”. Always the same, no data from today


(Matthieu Aubry) #7

I was able to reproduce it and fixed it today. It will be available in piwik 0.6


(edvsb) #8

The new version (rev=2096) does work, but not to 100%.

The first time archive.sh is called, the current data are written for today. However, the script called again (45 minutes later), then no change is made (time_before_today_archive_considered_outdated = 600). The statistics are still on the values from the first call.

Sorry about my english :frowning:

ok, it is a problem with the last rev=2084. “Unknown column ‘visit_server_date’ in ‘field list’” This field was deleted by the last rev…