Re: How to stop a cron job sending email



On Fri, Oct 31, 2008 at 10:58:22AM +0000, Chris Rees wrote:
2008/10/31 Johann Spies <jspies@xxxxxxxxx>:

# m h dom mon dow command
0-59/5 * * * * /usr/local/bin/krypos

$ cat /usr/local/bin/krypos
#!/bin/sh
killall fetchmail &> /dev/null
/usr/bin/fetchmail &> /dev/null

I have also tried

0-59/5 * * * * /usr/local/bin/krypos &> /dev/null

But I still get the email every 5 minutes.

That did not happen on my old computer.

How do I stop this?


The actual redirect should be 2>&1

Yes, or specify "#!/bin/bash" when using bashisms.

Alternatively, putting the line:

MAILTO=""

before any crontab actions has served me well to stop cron sending mail
in the first place, obviating the need to intercept it afterwards.

Erik

--
A computer is like an air conditioner, it stops working when you open Windows.
- Seen in Matthias Apitz's sig, on mutt-users.


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



Relevant Pages

  • Re: Hardware failure using Ctrl +C ?!
    ... A computer is like an air conditioner, ... it stops working when you open Windows. ... the terminal set? ...
    (comp.os.linux.misc)
  • Re: Disk Druid : swap partition can not be the 4th?
    ... A computer is like an air conditioner, ... it stops working when you open Windows. ... Registered Linux user #337974 ...
    (comp.os.linux.setup)
  • Re: Bug tracking system
    ... A computer is like an air conditioner, ... it stops working when you open Windows. ... Registered Linux user #337974 ...
    (comp.os.minix)
  • Re: www.minix3.org is Down!!!
    ... anybody facing the same problem ... A computer is like an air conditioner, ... it stops working when you open Windows. ...
    (comp.os.minix)
  • Web Page and Mouse
    ... monitor and the page is to wide for the screen. ... up,the mouse stops working, after the rev-up the mouse ... Sounds like a car idling and the air conditioner comes on ... the motor revs up and when the air conditioner cuts off ...
    (microsoft.public.windowsxp.general)