Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Operating System - Tru64 Unix
cancel
Showing results for 
Search instead for 
Did you mean: 

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
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