Opened 3 years ago

Closed 3 years ago

#2239 closed Bug (fixed)

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

Reported by: tthuermer Owned by:
Priority: normal Milestone: Piwik 1.3
Component: Documentation Keywords: cron
Cc: Sensitive: no

Description

archive.sh has:

echo "php binary not found. Make sure php5 or php exists in PATH."

the documentation suggests:
#MAILTO="youremail@…"
#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@….

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...

Change History (2)

comment:1 Changed 3 years ago by vipsoft (robocoder)

  • Component changed from Core to Documentation
  • Milestone set to 1.3 - Piwik 1.3

comment:2 Changed 3 years ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from new to closed

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

Note: See TracTickets for help on using tickets.