Monday, May 23, 2022
Centos Crontab

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 * * * script.sh | mail -s "Subject of Mail" someother@address.com 

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 * * * script.sh >/dev/null 2>&1 
(Visited 5 times, 1 visits today)
Klik untuk berbagi dengan orang lain
Baca Juga :  Cara Setting Apache Virtual Host pada CentOS 8

Similar Posts