Operating System - HP-UX
1834803 Members
2821 Online
110070 Solutions
New Discussion

Re: How to stop mails from cron jobs

 
Dave Walley_1
Occasional Contributor

How to stop mails from cron jobs

I have lots of jobs set to run under cron how can I stop some of them from
delivering mails every time they run. Due to the number of jobs the volume of
mails (elm's) is a problem.

Any advice would be of great help.

Dave
1 REPLY 1
John Booth_7
New Member

Re: How to stop mails from cron jobs

To stop emails from cron, you need to suppress
the output of the scripts or programs you
are having cron execute.

Something like the below cron entry
23 59 * * * /usr/local/scripts/clean_things 2> /dev/nul 1> /dev/nul

By putting the 2> /dev/nul and the 1> /dev/nul
That tells the shell to redirect output from
STDERR and STDOUT to the nul device which just
ignores anything sent to it. Without ignoring
the output you get an email as you have noticed.

John