While I favor the use of LogMonitor for absolutely everything there are simple commands you use in cron jobs for which ideally you would like to get notifications without the need of logging.
If you design your script carefully respecting the fact that error messages mut go to stderr this procedure should work:
- Be sure sSMTP is installed and properly configured:
$ sudo apt-get install ssmtp $ sudo vi /etc/ssmtp/ssmtp.conf ... email@example.com ... mailhub=mail.nestorurquiza.com ...
- Add a line at the beginning of crontab stating who the error email should me sent to:
$ crontab -e MAILTOfirstname.lastname@example.org 0 22 * * * /usr/sbin/sftp_backup.sh > /dev/null ...
Note the redirection of stdout to /dev/null. You want to receive I bet just errors right?