Re: How to stop a cron job sending email



True, it is a bad idea indeed. But if someone doesn't want to get
mails from cron, no matter what is happening then what else can be
done...? :)

2008/10/31 Karl Auer <kauer@xxxxxxxxxxxxxx>:
On Fri, 2008-10-31 at 16:34 +0530, Sambit Bikas Pal wrote:
If you want to complete disable mails from cron, add the following at
the top of the crontab-
MAILTO=""

In general, this is a Bad Idea.

Turning off all emailed output from cron is a good way to never find out
about stuff that is going wrong.

Scripts run from cron should handle any expected output themselves. That
will ensure that any unexpected output gets mailed to you.

Redirecting output from scripts to /dev/null in the crontab itself is a
Bad Idea for the same reason, but at least it can be applied on a
script-by-script basis. Also, you can choose to only redirect stdout, so
that unexpected output on stderr will still be mailed to you.




--
Sambit Bikas Pal
MS 3rd Year
Indian Institute Of Science Education & Research Kolkata,
HC 7, Sector-III Salt Lake, Kolkata-700106
Web: http://www.botcyb.org
OpenPGP Key: http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x8E57F8B897D372B3

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



Relevant Pages

  • Re: How to stop a cron job sending email
    ... Scripts run from cron should handle any expected output themselves. ... Redirecting output from scripts to /dev/null in the crontab itself is a ... that unexpected output on stderr will still be mailed to you. ...
    (Ubuntu)
  • cron messes up time format
    ... I've done this by using cron to run bash ... scripts which run python scripts which gather the data. ... since I think it's the difference between the bash shell I'm ...
    (comp.unix.bsd.freebsd.misc)
  • Re: [opensuse] Re: cron problems
    ... then job start logging is turned off. ... in message log when expected cron mail does a disappearing act. ... Which SUSE version is this? ... if the majority of the standard SuSE scripts explicitly log their status. ...
    (SuSE)
  • Re: What exactly does cron task weekly do?
    ... cron task weekly does. ... You don't have to run the scripts manually. ... I have never had my user crontab file modified in any way when prforming ... It is what anacron is for. ...
    (comp.sys.mac.system)
  • Re: cron messes up time format
    ... I've done this by using cron to run bash ... scripts which run python scripts which gather the data. ...   # `erase' character from control-H to DEL. ...
    (comp.unix.bsd.freebsd.misc)