Cron Job - How to send an output file to an email
From a crond perspective more accurate is to place in to your cron:
[email protected]
* * * * * /var/www/dir/sh/mysql_dumb.sh
* * * * * /var/www/dir/sh/other.sh
* * * * * /var/www/dir/sh/other2.sh
If the script is reporting errors, they may be going to stderr
, but you're only redirecting stdout
. You can redirect stderr
by adding 2>&1
to the command:
* * * * * /var/www/dir/sh/mysql_dump.sh 2>&1 | mail -s "mysql_dump" [email protected]