Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I have multiple cron job entries configured under a single account:

0 0 * * * /foo/
0 2 * * * /foo/
0 4 * * * /foo/

Right now, if any of these encounter an error, an email is sent to the user account. Can I configure cron to send a notification to a different email address depending on which entry encounters the error?

For example, if an error occurs while running /foo/ send to If an error occurs while running /foo/ send to

I know I can set but I think that's for ALL cron entries (for the account I'm logged in as)... I don't think that's a per-entry setting.

Hopefully this makes sense. Thanks. :-)

share|improve this question

2 Answers 2

up vote 6 down vote accepted

It it perfectly Ok to use MAILTO= per-entry, i.e.:

0  0 * * * /foo/
0  2 * * * /foo/
0  4 * * * /foo/
0  6 * * * /foo/
0  8 * * * /foo/
0 10 * * * /foo/

And so on.


share|improve this answer
Ah, I didn't know that was possible. That's exactly what I'm looking for. Thank you! – Mike B Aug 29 '14 at 16:13

I am not sure if this is what you are looking for. From that answer, I see it as,

* * * ...  your cron job
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.