Web Hosting Talk







View Full Version : Stop Cron Emails, Delete Sendmail Queue?


macker123
07-30-2004, 12:48 PM
All of my cron jobs seem to be sending emails to the root email address every second as I have lots of cron jobs running that need to run.

I seem to have over 5000 mails in my queue at the moment. My first questions is, how do I clear a send mail queue?

I logged into ssh and tried to get into the root mailbox, but it says no email is in there, yet the cron emails are being sent to root@ and I see 5000+ in the queue.

Also how do you make sure a cron does not send an email when it runs. I have a cron that says this:
php -f /sites/forumhoster.com/admin/chkserv.php

I was told if I change it to this it will stop emails, yet they are still being added to the queue:
php -f /sites/forumhoster.com/admin/chkserv.php>/dev/null 2>&1

Bashar
07-30-2004, 01:49 PM
is this cpanel server?

u can delete the files in the queue dir which will empty the queue

the line given should send all output to /dev/null and will send no emails unless the script has MAILTO entry to send email to

allera
07-30-2004, 01:55 PM
I'm not sure if this works in Linux, but in BSD, you can put this at the top of your crontab:

MAILTO=user@domain.com

Either try using /dev/null there, or create a dummy email account somewhere that forwards to /dev/null. I'm sure there's another way of doing it, though.

Originally posted by macker123
php -f /sites/forumhoster.com/admin/chkserv.php>/dev/null 2>&1

Try:

php -f /sites/forumhoster.com/admin/chkserv.php 2>&1 > /dev/null

2>&1 redirects stdout to stdin, the > then directs stdin to a file (/dev/null).