Turn off mail in crontab??

Turn off mail in crontab??

Post by Tom Edelbro » Sat, 23 Dec 2000 15:46:31



How can I turn off mail in crontab? The documentaion in "man 5 crontab" says
that if you set the environment variable "MAILTO" equal to nothing, ie:
MAILTO="" then you won't ge mail. However, the mail keeps coming!

What I do is this:

export MAILTO=""
printenv  |  grep  -i  mail

The "printenv" shows me that I have added MAILTO to my environment
variables. I am logged on as root during this entire process. But mail keeps
coming, (I have a script configured as "0-59/5 * * * *  /myscriptname" in
crontab).

How can I turn this mail off? The command I have is run every 5 minutes
forever, and generates an e-mail every single time (because of the nature of
the script). I don't want to fill up the disk with mail.

Alternatively can I do something to ensure that mail gets flushed after a
certain age so the disk doesn't fill up?

Thanks in advance,
Tom

 
 
 

Turn off mail in crontab??

Post by Peter T. Breue » Sat, 23 Dec 2000 16:04:45



> How can I turn off mail in crontab? The documentaion in "man 5 crontab" says
> that if you set the environment variable "MAILTO" equal to nothing, ie:
> MAILTO="" then you won't ge mail. However, the mail keeps coming!

If it's a bug, tell the author about it. I believe MAILTO works for me.
Are you using cron, or anacron?

Quote:> What I do is this:
> export MAILTO=""
> printenv  |  grep  -i  mail
> The "printenv" shows me that I have added MAILTO to my environment
> variables. I am logged on as root during this entire process. But mail keeps
> coming, (I have a script configured as "0-59/5 * * * *  /myscriptname" in
> crontab).
> How can I turn this mail off? The command I have is run every 5 minutes

Don't produce output on stdout or stderr in cron. Redirect to /dev/null
if you don't want cron's warning messages.

Quote:> forever, and generates an e-mail every single time (because of the nature of
> the script). I don't want to fill up the disk with mail.

Peter

 
 
 

Turn off mail in crontab??

Post by Bob Hau » Sun, 24 Dec 2000 08:43:40



>How can I turn off mail in crontab?
>The "printenv" shows me that I have added MAILTO to my environment
>variables.

Which is not the same environment that the crontab will be running in.
To set environment variables in cron, you must put them at the top of
your crontab.

Quote:>(I have a script configured as "0-59/5 * * * *  /myscriptname" in
>crontab).

You probably don't mean "/myscriptname" unless the script is in your
root directory.  More likely you mean something like "/home/me/script".

Also, you could redirect output to /dev/null to prevent mail being sent:

myscriptname > /dev/null 2>&1

--
 -| Bob Hauck
 -| To Whom You Are Speaking
 -| http://www.haucks.org/

 
 
 

1. Turning off Mail-Watcher in Linux mail

Everytime I get new mail,  by system beeps, and I have 5 (or so) lines
pop up
on my screen.  What-ever it is, also changes my mailbox atime.

First, it is really annoying to have these messages pop up on the
screen
(especially while I'm editing something).

Second, I have another "Mail-Watcher" (TKDesk) that never 'sees' new
mail
because the 'other' Mail-Watcher has changed the access time of my
mailbox.

Where is this other "Mail-Watcher" coming from?  I don't see anything
that
stands out in a 'ps'.  And how do I turn off this first Mail-Watcher?


Thanks in advance for the help!

Jon

--
                     \\\|///
                   \\  - -  //

+-----------------oOOo-(_)-oOOo------------------------+
| Jon D. Slater                     Sacred Fire        |

| 970.229.5752                      Ft. Collins, CO    |
+--------------------------Oooo------------------------+
                    oooO   (   )
                   (   )    ) /
                    \ (    (_/
                     \_)
?

2. Dual monitor support

3. Using crontab to turn on and off 'mesg'

4. Root Volume -- Solaris 9

5. How to turn off cron mail?

6. A go-slower feature on Sparcs

7. Q: Turning off new mail notification

8. linux header files (include files)

9. Turning off mail notification when printer down

10. turn off notification of incoming mail

11. Mail notify, How t turn it off?

12. How to turn off beeping when new mail arrives ?

13. how do i turn mail off?