On Fri, Mar 02, 2001 at 11:47:08AM -0500, goldengull.net administrator wrote:
> how do i get my hourly cron jobs to not mail me.  this is killing my
> email!  i don't mind daily or weekly, but hourly is a little to
> expensive.

You can redirect standard out to /dev/null, and leave standard error
alone to get mailed only when there are errors.  For example, this could
be useful if you're running fetchmail out of a cron job.  The "normal"
(output to stdout) messages will be thrown away, but any errors (output
to stderr) will be mailed to you.

0 * * * *     /usr/bin/fetchmail > /dev/null             

If you're sure you want to ALWAYS discard the output and never receive
mail, then you have to redirect standard error (stderr, fd 2) to
/dev/null as well.

0 * * * *       /usr/bin/fetchmail > /dev/null 2>&1

Note this is Bourne Shell syntax, since /bin/sh is the default shell.

Also note that this will work on pretty much ANY unix or unix-like
system, not just Linux. 

                                              -michael

-- 
Michael Jarvis
[EMAIL PROTECTED]
http://www.jarvis.com/home.php
"Freiheit stirbt in kleinen Stücken."

Reply via email to