[Piwik-svn] r521 - in trunk/misc: . cron

svnmaster at piwik.org svnmaster at piwik.org
Tue Jun 10 02:26:36 CEST 2008


Author: matt
Date: 2008-06-10 02:26:35 +0200 (Tue, 10 Jun 2008)
New Revision: 521

Added:
   trunk/misc/cron/
   trunk/misc/cron/archive.sh
Log:
- adding cron tab file that users can execute to automatically archive their piwik data every day (or every hour)

Added: trunk/misc/cron/archive.sh
===================================================================
--- trunk/misc/cron/archive.sh	                        (rev 0)
+++ trunk/misc/cron/archive.sh	2008-06-10 00:26:35 UTC (rev 521)
@@ -0,0 +1,20 @@
+#!/bin/bash -e
+
+# run this cron for example every hour, content of your /etc/cron.d/piwik-archive
+#MAILTO="youremail at example.com"
+#1 * * * * www-data /path/to/piwik/misc/cron/archive.sh > /dev/null
+
+# for high traffic websites, in config/global.ini.php
+# * time_before_archive_considered_outdated = 3600
+# * enable_browser_archiving_triggering = false
+
+TOKEN_AUTH="" #you can get the token_auth from the Piwik admin UI (section Users, or section API)
+
+PHP_BIN=/usr/bin/php5
+PIWIK_PATH=/home/www/piwik/demo/index.php
+
+for period in day week year; do
+  CMD="$PHP_BIN $PIWIK_PATH -- module=API&method=VisitsSummary.getVisits&idSite=all&period=$period&date=last52&format=xml&token_auth=$TOKEN_AUTH";
+  $CMD
+  echo ""
+done



More information about the Piwik-svn mailing list