Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattpiwik <matthieu.aubry@gmail.com>2008-06-10 04:26:35 +0400
committermattpiwik <matthieu.aubry@gmail.com>2008-06-10 04:26:35 +0400
commit863ab04d838375b4b5ab0015fc131a83665357eb (patch)
treefd38e6ed730ba1d0f5d3be1400fc353dc1b9d69f /misc/cron/archive.sh
parented7ea52067dd7a224672891c6c068082e0cc4284 (diff)
- adding cron tab file that users can execute to automatically archive their piwik data every day (or every hour)
git-svn-id: http://dev.piwik.org/svn/trunk@521 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'misc/cron/archive.sh')
-rw-r--r--misc/cron/archive.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/misc/cron/archive.sh b/misc/cron/archive.sh
new file mode 100644
index 0000000000..81f3b1837d
--- /dev/null
+++ b/misc/cron/archive.sh
@@ -0,0 +1,20 @@
+#!/bin/bash -e
+
+# run this cron for example every hour, content of your /etc/cron.d/piwik-archive
+#MAILTO="youremail@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