cpragman 05-22-2005, 12:33 AM
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.
"/tmp/crontab.FRHPisVp3G":1: bad minute
crontab: errors in crontab file, can't install
I don't get it. I can change this file in all kinds of ways without error, but as soon as I add the "MAILTO=" line, it throws this error.
Any ideas what I'm doing wrong?
voldenuit 05-22-2005, 03:35 PM
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.
ajp 05-22-2005, 04:45 PM
why have the mailto variable set at all. remove or comment it out and see what happens.
cpragman 05-22-2005, 07:04 PM
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.
cpragman 05-23-2005, 07:15 AM
I solved this one last night.
The correct syntax to add to the crontab file is as follows:
MAILTO=""
My problem was that I left out the empty quotes. Once I fixed that, no new messages were added to /var/spool/postfix/maildrop.
|