archive.sh is normally run via cron so the output is sent by email. These normal status messages are not very useful IMHO but get annoying when received every day.
This patch prevents sending out mails:
--- archive.sh.old 2009-06-26 09:55:24.000000000 +0200 +++ archive.sh 2009-06-26 09:55:40.000000000 +0200 @@ -33,6 +33,5 @@
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 "" - $CMD > /dev/null done
The echo is needed when the script is executed from the shell.
To suppress the emails, use >/dev/null 2>/dev/null in your crontab.
I guess it is more often run via cron job. Isnt there a possibility to check wether the script is run via command line and to only output info in that case?
expected behavior is: an email is sent only when the archiving fails and returns an error. It works fine for me?