Scheduled Cron Job - How to disable email to root

2 posts / 0 new
Last post
#1 Mon, 09/17/2007 - 22:57
ah...lifes...good

Scheduled Cron Job - How to disable email to root

> Webmin > System > Scheduled Cron Jobs

I noticed that whenever a cron job is run, an email gets sent to the server root's email address.

It is annoying because it is taking up unnecessary server space in the email folder and bogging me down whenever I want to check the LogWatch email.

So I asked our Webmin genius what can we do to stop the automatic email to root. Below is his answer.

I have used Jamie's suggested Option 1 - simply insert >/dev/null 2>&1 at the end of the command (with a space in between of course). It works like a charm. Thanks Jamie!

Jamie:

1) Change the command to put >/dev/null 2>&1 at the end, which causes all output to be thrown away.

2) In the Cron module, add an environment variable named MAILTO whose value is some other address that you want email sent to. This can be left empty to have the email sent nowhere. Just make sure you put this MAILTO variable before the Cron entry for the command whose output you don't want. This can be done using the up and down arrows in the list.

Sat, 01/14/2017 - 11:48
-eclipse-

Hi

Option 1 works like a charm :)

  • Tim
Topic locked