On 2001-12-07 (Friday) at 09:46:26 +0000, Paul Roberts wrote:
> On Thu, Dec 06, 2001 at 11:56:33PM +0100, Cliff Sarginson wrote:
> > Cron will mail the standard output and error to you by default.
> > Try appending the following to the end of the cron command:
> > 
> >         2>&1 >/dev/null
> 
> If i'm not mistaken, this will result in no output. Append this on the
> end instead to still be mailed errors (if any):
> 
> 1>/dev/null
> 
> (in fact, the 1 is not even required, its the detfault). File
> descriptor 2 is stderr, which is where errors should be dumped.

Actually both will work although yours is probably the better one to
use (shorter and less confusing).  In Cliff's answer stderr gets
redirected to where stdout was going (which is superfluous in this
context), then stdout gets redirected to /dev/null.  To redirect both
stdout and stderr to /dev/null you'd have to reverse the order:

  >/dev/null 2>&1

Mark.

Attachment: msg21221/pgp00000.pgp
Description: PGP signature

Reply via email to