cron/archive.sh writes error messages to stdout, but stdout is discarded with the default crontab entry #2239

Closed
anonymous-piwik-user opened this Issue Mar 29, 2011 · 1 comment

2 participants

@anonymous-piwik-user

archive.sh has:
echo "php binary not found. Make sure php5 or php exists in PATH."

the documentation suggests:
#MAILTO="youremail@example.com"
#5 * * * * www-data /path/to/piwik/misc/cron/archive.sh > /dev/null
#-----------------END CRON TAB--

When an error occurs (eg. php memory error, timeout) the error messages

will be sent to youremail@example.com.

so if php-cli is not available, the error message will be discarded...

so this should be:
echo "php binary not found. Make sure php5 or php exists in PATH." >&2

to print the message to stderr...

as a sidenote:
php notoriously prints it's error messages (like the memory/timeout errros mentioed in the documentation above) to stdout instead of stderr, so those would likely be discarded aswell...
Keywords: cron

@mattab
Piwik Open Source Analytics member

(In [4227]) Fixes #2239 Thanks for the report tthuermer!

@anonymous-piwik-user anonymous-piwik-user added this to the Piwik 1.3 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment