From: Big and Blue on
On 05/16/10 12:48, Tony Houghton wrote:

> The bug report referred to above explains the reason for that construct:
> it ignores the exit code of 1 but still warns about other non-zero codes
> which you may want to know about.

True. But the OP wanted to stop all mail - hence the thread title.

--
Just because I've written it doesn't mean that
either you or I have to believe it.
From: Nix on
On 15 May 2010, alexd verbalised:
> and putting || [ $? -eq 1 ] on the end of the command does the trick.

Also spelt

|| true

which is a lot easier to read, I find.
From: Nix on
On 16 May 2010, Bruce Stephens spake thusly:

> Big and Blue <No_4(a)dsl.pipex.com> writes:
>
>> On 05/15/10 21:41, alexd wrote:
>>
>>> and putting || [ $? -eq 1 ] on the end of the command does the trick.
>>
>> or, presumably:
>>
>> ; exit 0
>
> I tend to use "|| true", FWIW.

I tend to not read threads until I've repeated what someone else has
said. But that's just me.
From: Justin C on
On 2010-05-15, alexd <troffasky(a)hotmail.com> wrote:
> On 15/05/10 20:40, Chris wrote:
>> On Sat, 15 May 2010 19:05:42 +0100, Jim A <ja(a)averyjim.myzen.co.uk> wrote:
>
>>> Personally if I don't want mail for an individual crontab entry, I
>>> redirect output to /dev/null so I haven't tried that method myself.
>>
>> Same here. The added advantage of /dev/null is that it only affects one
>> of the cron jobs. The MAILTO= option would affect them all.
>
> Alas Debian's crontab now reports the exit status of the job if nonzero,
> and it runs once a minute, so I'm getting hundreds of emails every day.

Doesn't a redirect work? On each line of the crontab, for those that I
want to receive no mail, I have "> /dev/null 2>&1". This redirects both
STOUT and STDERR to /dev/null. You shouldn't see anything.

Justin.

--
Justin C, by the sea.
From: Tom Anderson on
On Thu, 20 May 2010, Justin C wrote:

> On 2010-05-15, alexd <troffasky(a)hotmail.com> wrote:
>> On 15/05/10 20:40, Chris wrote:
>>> On Sat, 15 May 2010 19:05:42 +0100, Jim A <ja(a)averyjim.myzen.co.uk> wrote:
>>
>>>> Personally if I don't want mail for an individual crontab entry, I
>>>> redirect output to /dev/null so I haven't tried that method myself.
>>>
>>> Same here. The added advantage of /dev/null is that it only affects one
>>> of the cron jobs. The MAILTO= option would affect them all.
>>
>> Alas Debian's crontab now reports the exit status of the job if nonzero,
>> and it runs once a minute, so I'm getting hundreds of emails every day.
>
> Doesn't a redirect work? On each line of the crontab, for those that I
> want to receive no mail, I have "> /dev/null 2>&1". This redirects both
> STOUT and STDERR to /dev/null. You shouldn't see anything.

If Debian is sensitive to nonzero exits, it wil still write to Alex about
that. But that's easily solved with an || true after the command.
tom

--
The revolution is here. Get against the wall, sunshine. -- Mike Froggatt