cron send alert to email

Specify Email for Each Script

If we don’t want all output to go to the same email address we can specify the output of a particular script to go to a different email address:

59 */6 * * * | mail -s "Subject of Mail" 

Email Alerts for All but One

If you have a specific script in your crontab that you don’t want output or errors emailed to you, simply add, ‘>/dev/null 2>&1’ to the end of the command.

59 */6 * * * >/dev/null 2>&1 
Klik untuk berbagi dengan orang lain
Baca Juga :  Cara Install Ruby pada CentOS 8
%d bloggers like this: