Operating System - Tru64 Unix
1748250 Members
3567 Online
108760 Solutions
New Discussion юеВ

Stifling emails from cron?

 
Gordon  Morrison
Trusted Contributor

Stifling emails from cron?

We have a TRU-64 server that is sending out about 5000 emails a day, and while a few of them are legitimate and needed, most of them are automatically generated, and after being routed all over our network, they just come straight back to the box that generated them.
They are not needed or even wanted and never get read. they aren't even necessarily error reports: they all have a footer like this:

*************************************************
Cron: The previous message is the standard output
and standard error of the following at job:

blah_blah.1253892125.a


Is there an easy way of either configuring cron/at NOT to generate these emails, or at the very least, configuring sendmail not to send them out into the network, as they only come straight back anyway? Our Corporate Messaging team wants their bandwidth back.
What does this button do?
2 REPLIES 2
Steven Schweda
Honored Contributor

Re: Stifling emails from cron?

If you do something with the job's output
yourself, then "cron" won't need to do
anything with it. "man at":

[...]
DESCRIPTION

Both at and batch mail you the standard output and standard error from the
scheduled commands, unless you redirect that output. They also write the
job number and the scheduled time to standard error.
[...]

Of course, if you redirect a job's output to
some files, then you may need to look at the
files to see what happened. You may also
wish to purge these files from time to time.

> [...] configuring sendmail not to send them
> out into the network [...]

Like many computer programs, sendmail does
what you tell it to do. My psychic powers
are too weak to tell me much about your
sendmail configuration.

Re: Stifling emails from cron?

Also I cannot know the details of your script but you may try to add the following parameters to the end of your cron job line
... >/dev/null 2>/dev/null
which will send standard output and error to null device.
So the entry should look something like the following;
30 7 * * 1 /script_dir/SCRIPT >/dev/null 2>/dev/null