Re: crontab email
On Thu, Mar 04, 2004 at 10:56:55AM -0600, Brian Henning wrote: > Everytime something runs from the the crontab for a given user such as root, I > get an email with the results of the execution. I am running a few crontabs that > run every 2 minutes and this gets to be a lot of excess email. How can I turn > off this feature. Either set the MAILTO variable at the top of the crontab file to an empty string, or redirect stdout and stderr from each of the commands to /dev/null -- something like: 5 * * * * yourcommandhere >/dev/null 2>&1 See crontab(5) for details of MAILTO and sh(1) for how to redirect the file descriptors. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK pgp0.pgp Description: PGP signature
Re: crontab email
[Brian Henning, 2004-03-04] > Everytime something runs from the the crontab for a given user such as root, I > get an email with the results of the execution. I am running a few crontabs that > run every 2 minutes and this gets to be a lot of excess email. How can I turn > off this feature. You only get mail if the script produces any output. Put a >/dev/null at the end of the commandline, and you will only get mail when something is written to stderr, not stdout. Svein Halvor ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: crontab email
Brian Henning wrote: Greetings: Everytime something runs from the the crontab for a given user such as root, I get an email with the results of the execution. I am running a few crontabs that run every 2 minutes and this gets to be a lot of excess email. How can I turn off this feature. #man 5 crontab In addition to LOGNAME, HOME, and SHELL, cron(8) will look at MAILTO if it has any reason to send mail as a result of running commands in ``this'' crontab. If MAILTO is defined (and non-empty), mail is sent to the user so named. If MAILTO is defined but empty (MAILTO=""), no mail will be sent. Otherwise mail is sent to the owner of the crontab. This option is useful if you decide on /bin/mail instead of /usr/lib/sendmail as your mailer when you install cron -- /bin/mail doesn't do aliasing, and UUCP usually doesn't read its mail. PWR ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"