Sunday, August 17, 2025
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" [email protected] 

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 49 times, 1 visits today)
Baca Juga :  Welcome to emergency mode! Give root password for maintenance after logging in - Centos 7

Similar Posts