Re: How to stop a cron job sending email



On Fri, Oct 31, 2008 at 10:58:59AM +0000, Chris Rees wrote:

The actual redirect should be 2>&1

From 'man bash'

Redirecting Standard Output and Standard Error

Bash allows both the standard output (file descriptor 1) and
the standard error output (file descriptor 2) to be redirected
to the file whose name is the expansion of word with this construct.

There are two formats for redirecting standard output and
standard error:

&>word
and
>&word

Of the two forms, the first is preferred. This is semantically
equivalent to

>word 2>&1

Regards
Johann

--
Johann Spies Telefoon: 021-808 4036
Informasietegnologie, Universiteit van Stellenbosch

"Bless the LORD, O my soul, and forget not all his
benefits: Who forgiveth all thine iniquities; who
healeth all thy diseases; Who redeemeth thy life from
destruction; who crowneth thee with lovingkindness and
tender mercies; Who satisfieth thy mouth with good
things; so that thy youth is renewed like the
eagle's." Psalms 103:2-5

--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



Relevant Pages

  • Re: Shell: Ausgabe komplett =?iso-8859-1?Q?unterdr=FCcken?=
    ... Redirecting Standard Output and Standard Error ... Bash allows both the standard output (file descriptor 1) and the standard ... There are two formats for redirecting standard output and standard error: ...
    (de.comp.os.unix.linux.misc)
  • Re: cron MAILTO
    ... "If standard output and standard error are not redirected by commands ... executed from the crontab entry, any generated output or errors will ... > searching, ?My Bridgeman section for managing your images, inspiring ...
    (freebsd-newbies)
  • Re: Cron script dies after first tar
    ... > If standard output and standard error are not redirected by commands ... If so, I'd expect it to just stop the mail, but not affect the commands ... But the OP could try redirecting stdout and stderr to a file in case ...
    (comp.unix.shell)
  • tee redirection problems
    ... I would like to output the standard error from a script ... to the error log and the the standard output to an output log. ...
    (comp.unix.shell)
  • Re: tee redirection problems
    ... I would like to output the standard error from a script ... > to the error log and the the standard output to an output log. ...
    (comp.unix.shell)