Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.14 KB

Cron.md

File metadata and controls

42 lines (29 loc) · 1.14 KB

Could be :

  • The PATH variable isn't correct (and the given executable couldn't be loaded)
  • the cron daemon isn't working
  • There is no line break at the end of the crontab file (weird error, note sure it's still important)

  • Mail the result of the cron
0 7 * * *  /home/user/backup/travail/synchro.sh | mail 'synchro prod89' [email protected]

http://stackoverflow.com/questions/1396506/cron-send-email-with-stderr-but-not-stdout

For cron you don't need to pipe through mail. The cron daemon will automatically mail any output of your command to you. Your crontab entry should look like:

# every minute
* * * * * ./prog >/dev/null

If there is no STDERR output, you won't get any mail.

Append string >/dev/null 2>&1 to stop mail alert:
0 1 5 10 * /path/to/script.sh >/dev/null 2>&1

OR
0 1 5 10 * /path/to/script.sh &> /dev/null

Tuto

https://help.ubuntu.com/community/CronHowto