|
|
#1 |
|
All Star
Join Date: Jan 2004
Location: Limerick, PA
Posts: 858
|
Stop Cron from mailing messages
I've found tons of undelivered cron messages in my /var/spool/clientmqueue folder (from Jaguar), and now panther seems to be stuffing them into /Var/spool/postfix/maildrop.
I cleaned 17GB out of /var/spool/clientmqueue last night. This has got to stop. I know I can enable sendmail and configure forwarding for root to pass these along to a regular mail account, but I'd rather not bother. I'd like to make cron stop mailing these notices. I see that I can edit my crontab file to add the variable "MAILTO=" and it will stop. This seemed to work for ROOT, but when I try to edit my own user crontab file (crontab -e), I get an error message that makes no sense. Code:
"/tmp/crontab.FRHPisVp3G":1: bad minute crontab: errors in crontab file, can't install Any ideas what I'm doing wrong? Last edited by cpragman; 05-22-2005 at 07:59 PM. |
|
|
|
|
|
#2 |
|
League Commissioner
Join Date: Sep 2003
Location: Old Europe
Posts: 5,146
|
How about redirecting stderr and stdout to /dev/null ?
That's how I do it, I didn't even know about the trick you try to use. |
|
|
|
|
|
#3 |
|
Triple-A Player
Join Date: Oct 2003
Location: Philadelphia, PA, USA
Posts: 80
|
why have the mailto variable set at all. remove or comment it out and see what happens.
|
|
|
|
|
|
#4 |
|
All Star
Join Date: Jan 2004
Location: Limerick, PA
Posts: 858
|
ajp,
There is no "MAILTO=" parameter set by default in the system's crontab file, you have to add it manually. According to "man 5 crontab", cron automatically generates a mail message to the user spawning the job. That means that on my system, I can count on a couple of root jobs a day, plus numerous user jobs per day. Adds up quickly. If the MAILTO= parameter is provided with a username , the mail goes to that user. If the "MAILTO=" is provided with no user name, then no mail is generated (i.e., black hole). The REAL problem I'm having is that the system's crontab (i.e., /etc/crontab) accepts the "MAILTO=" variable, yet for some reason my user's crontab filed (edited with "crontab -e") refuse to accept any file I provide that has "MAILTO=" in it. |
|
|
|
|
|
#5 |
|
All Star
Join Date: Jan 2004
Location: Limerick, PA
Posts: 858
|
I solved this one last night.
The correct syntax to add to the crontab file is as follows: Code:
MAILTO=""
|
|
|
|
![]() |
|
|