[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

8581.0. "cron sending mail to root (not me)" by DECC::SULLIVAN (Jeff Sullivan) Fri Jan 24 1997 12:18

I run several cron jobs overnight, which I've set up using the crontab command.
The cron jobs have been working flawlessly for months. On other UNIXes, the
output from the commands were then mailed to me (not root). On Digital UNIX
V4.0, the cron output is mailed to root.

It's not that I miss the mail. In fact, I used to set up my elm filter to
redirect it away from my inbox. The problem is that the root mail file gets
extremely large (several megabytes when I found it earlier this week).

Is this correct behavior?
How can I get the cron job to mail *me* the output or not mail it at all?

Thanks,
-Jeff
T.RTitleUserPersonal
Name
DateLines
8581.1/.forwardAPACHE::CHAMBERSTue Jan 28 1997 16:035
Easy - just put your email address into a file called "/.forward", and
when cron tries sending it to root, the mailer will bounce it to you.

This is assuming that root's home directory is /, of course.  If it's
some other directory, put the .forward file there.
8581.2try >/dev/nullUSMV01::DOUCETTEUse your judgementWed Jan 29 1997 12:073
	I seem to remember that you can put  >/dev/null at the end of your
	entry in the cron file and no mail will be sent. Been a while...
8581.3APACHE::CHAMBERSThu Jan 30 1997 11:1610
> ... you can put  >/dev/null at the end of your
> 	entry in the cron file and no mail will be sent. Been a while...

Close.  You usually need ">/dev/null 2>&1", to suppress both stdout and
stderr.  Most of the messages that cron emails to root contain error
messages, and usually they were written to stderr.

Of course, this assumes that you want to suppress the mail entirely rather
than send it to someone who might try to correct the problems.