Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple cronjob emails

Tags:

bash

unix

cron

I have 3 jobs in my crontab. I want to recieve emails if only 1 of them fails and not for other two. Is there any way to restric emails to one type of cronjob?

like image 519
McQueen Avatar asked Oct 13 '10 14:10

McQueen


People also ask

What is the use of * * * * * In cron?

* * * * * is a cron schedule expression wildcard, meaning your cron job should run every minute of every hour of every day of every month, each day of the week.

How could you send the output from these cron jobs to another e mail address?

In the beginning of a crontab file you could use the MAILTO instruction to indicate you want the output to be sent as an e-mail to an e-mail address.

Can crontab send emails?

Log management systems and cron job monitoring systems can send email notifications, but they specialize in specific tasks.

What is the difference between Cronjob and crontab?

Crontabs are the configuration files used by Cron to run services. Crontabs hold the configurations for which service to run and when it should run. Services are nothing more than an execution path to a script or application with possible additional commands. Cronjobs are the individual entries in that Crontab file.


1 Answers

Redirect the output of the two you don't care about to /dev/null if you don't ever want to see the output or to some file if you do.

like image 193
Blrfl Avatar answered Sep 19 '22 01:09

Blrfl