[Piwik-hackers] Enhanced Archive Cron Script

Soren Pedersen soren at simulation.dk
Tue Jun 3 11:42:56 CEST 2008


Thanks for that. Very usefull.

I actually think this should be a core feature but this will works great
until then.


2008/6/3, Claudio Moratti <maxer at knio.it>:
>
> Hi!
> My name is Claudio, and this is my first message on this mailing-list :)
>
> I have started using piwik one week ago, in order to collect
> statistics about the Italian Debian Community (
> http://www.debianizzati.org ).
> There are 4 section, for a total of 2000 visits every day... If could
> be useful, I can send information about how piwik works in this
> situation ;)
>
> I notice a nice Cron for an automatic archiving task, but it is linked
> only to one site...
> I wrote this small bash script, that can extract all 'idsite' and
> process everyone...
>
> Hope this can help someone ;)
> ==
> #!/bin/bash
> USER="piwik-user"
> PASSWORD="piwik-pass"
> DATABASE="piwik"
>
> PIWIK_PATH="/var/www/piwik/"
> TOKEN="theadmintoken"
>
> AUTH="-u $USER -p$PASSWORD"
> for ID in ` mysql $AUTH -D $DATABASE -Bse 'SELECT idsite FROM piwik_site'`
> do
>        /usr/bin/php5 $PIWIK_PATH/index.php --
>
> "module=API&method=VisitsSummary.getVisits&idSite=$ID&period=year&date=today&format=original&token_auth=$TOKEN"
> > /dev/null
>        /usr/bin/php5 $PIWIK_PATH/index.php --
>
> "module=API&method=VisitsSummary.getVisits&idSite=$ID&period=week&date=last52&format=xml&token_auth=$TOKEN"
> > /dev/null
> done
> ==
>
> cheers
> claudio
>
> --
> Claudio Moratti
> maxer at knio.it
> _______________________________________________
> Piwik-hackers mailing list
> Piwik-hackers at piwik.org
> http://lists.piwik.org/cgi-bin/mailman/listinfo/piwik-hackers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.piwik.org/pipermail/piwik-hackers/attachments/20080603/7dd139ed/attachment-0001.htm 


More information about the Piwik-hackers mailing list