public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Cron and disabling emails for one script only
@ 2021-04-06 17:43 Dale
  2021-04-06 18:24 ` antlists
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Dale @ 2021-04-06 17:43 UTC (permalink / raw
  To: gentoo-user

Howdy,

I set up a hard drive to backup my emails, world file, /etc and a couple
other things.  I been doing it manually but finally set up a cron job to
run it automatically.  I call it a script but some may laugh at me
calling it that.  Anyway, I got cron to run it just fine.  It runs and
copies it over just like it should.  I set it to do that each hour. 
Thing is, it sends a email every time it does it.  I don't mind a email
if there is a error but don't want one if it runs successfully.  This is
the cron file I set up.  It's placed in the hourly directory.


#!/bin/bash
/root/mail-backup > /dev/null 2>&1 || true
# >/dev/null 2>&1


I got a lot of hits doing a google search and the only thing I see is to
direct it to /dev/null.  From examples I've seen, this should work.  I
then ran across the one currently up there with true in it.  I don't
understand that but tried it anyway.  It still sends emails.  I also
tried the one commented out below that as well.  Still emails. 

Keep in mind, I do not want to disable ALL emails, just this one
script.  How does one disable emails for this one cron job?  Do I have a
typo or putting it in wrong place maybe?  Everything I found shows this
should work but obviously I'm doing something wrong.  Again, error
emails are fine.  I don't want successful runs tho. 

Thanks much.

Dale

:-)  :-) 


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-04-07 15:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-06 17:43 [gentoo-user] Cron and disabling emails for one script only Dale
2021-04-06 18:24 ` antlists
2021-04-06 18:43 ` Neil Bothwick
2021-04-06 19:42   ` Dale
2021-04-06 20:28     ` Neil Bothwick
2021-04-06 19:58 ` John Covici
2021-04-06 23:51   ` Dale
2021-04-07  7:32     ` Neil Bothwick
2021-04-07  8:22       ` Dale
2021-04-07 14:26         ` Neil Bothwick
2021-04-07 15:47           ` Dale

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox