Helpful Crontab Variables
Set these at the top of your crontab to avoid surprises. Controls output emails, working dir, shell, and path. Saves you from debugging weird env issues later.
# When your cron jobs have output, or, when they fail, email is sent to the following addresses
MAILTO="foo@bar.com,baz@qux.com"
# The path of the user whose crontab you're setting up.
# Use echo $PATH and copy the contents into the PATH variable
PATH="/usr/bin:/sbin:/bin"
# The home directory that your crontab should be working in.
# This can replace needing to cd /path/to/app/root in each script and using absolute paths.
HOME="/path/to/app/root"
# The default shell that your crontab uses may differ from what you need.
# Use echo $SHELL and copy the contents into the SHELL variable.
SHELL="/bin/bash"