4 ms·
I have this problem, I only want to be emailed upon failure. However, the crontab of the account is shared by several different jobs run by different people, a
by dfrankow 14y ago
I have this problem, I only want to be emailed upon failure. However, the crontab of the account is shared by several different jobs run by different people, and I don't have control over that. Perhaps I could set the email in the crontab line?
* * * * * MAILTO=me@example.com blahscript.sh
- Dobbs 14y agoblahscript.sh | mail -s "Subject" me@example.com
- asjo 14y agoYou can set MAILTO by itself between the job lines in the crontab; e.g.: MAILTO=user1@example.com * */10 * * * script1 5 * * * * script2 MAILTO=user2@example.com * * * * * script3 Any output from script1 and 2 will be sent to user1 and any from script3 to user2.