Szerző: Nick Dátum: Címzett: dng Tárgy: Re: [DNG] Problem with cron-job emails
On 19-04-2025 14:33, Ken Dibble wrote: >
>> As per the earlier response, the only other solution that I am aware
>> of (and at least used to work) is appending >/dev/null 2>&1 so that
>> all of the output is thrown away and there is nothing to mail.
>>
>>
>> Maybe you'll have better luck with that.
>>
>> Regards,
>>
>> Ken
>>
> Following up on your problem.
>
> I am unsure why MAILTO is failing.
>
> According to man 5 crontab
>
> "If MAILTO is defined (and non-empty), mail is sent
> to the user so named. If MAILTO is defined but empty
> (MAILTO=""), no
> mail will be sent."
>
> Maybe someone more knowledgeable can chime in.
>
> Regards,
>
> Ken
Not much more knowledgeable but AFAIK the only way to suppress mail from
cron completely is to make sure the cronjob is not generating any output
on standard output as well on standard error. MAILTO when filled in will
send mail output from both channels. When not filled a mail will still
be send on system level when any output on standard error has been
generated.