Stopping Cron Mail to administrator


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Stopping Cron Mail to administrator
# 1  
Old 02-12-2009
Tools Stopping Cron Mail to administrator

I have written a number of shell scripts which I have added to cron to run on an Apple Xserve running MAc OS Server 10.4.11.

Recently I configured postfix to use one of my company's email servers as a relay so that it can send out statistics about the number of jobs my shell scripts have processed.

The problem is that I've just brought the email server to its knees when it received approx 45,000 mail from the Xserve, I can only assume that these mail must be legacy messages from cron which the server has now decided to send via the email server. So

1. Does anyone know why these messages for the local administrator account are now routed via the external email server

2. How can I stop cron sending out messages to administrator

Thanks in advance for any help as my eMail admin wants to crucify me!!!
# 2  
Old 02-18-2009
You can tell all cron jobs to redirect their output and stderr to /dev/null.
Code:
* * * * * cronjob.sh >/dev/null 2>&1

Of course, then you will see nothing from the crons.

Meanwhile, how is mail configured? Do you have an /etc/aliases file? (I very little about MacOS)
# 3  
Old 02-19-2009
Thanks Otheus

I assume that I would have to add dev/null redirect to each and every cronjob within the crontab.

I found another solution which is adding EMAILTO="" to the start of the crontab, I haven't had chance to test it yet, so I'm not 100% sure if it works

With regard to mail configuration, I have used postfix act as a relay to our mail system (Lotus Notes). There is an /etc/aliases file but postfix adds aliases using its mail.rc file - this works sucessfully
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Stopping cron job

Hi, I have scheduled one job in crontab. I want to stop the job automatically after some time of its execution without killing it. Could i archive the above? (8 Replies)
Discussion started by: mehulleo
8 Replies

2. Shell Programming and Scripting

Mail Attachment Not Working for Cron

Hi All, i Have An Script Which is Fetching Data From DB And sending Mail With the Data in Excel Format. i'm Receiving Mail with Attachment when i Manually Running the script using ksh -x Scriptname or ./ Scriptname. when i try to run it through cron i'm receiving mail only but ... (7 Replies)
Discussion started by: naveen1.kumar
7 Replies

3. Red Hat

stopping you have mail.....

Hi, on server Red Hat Enterprise Linux AS release 3, I am getting the mail "you have mail" can any body suggest how to stop this? mail are getting generated in below path. /var/spool/postfix/maildrop, due to which heavy file are getting generated. though sendmail service is stopped. ... (0 Replies)
Discussion started by: manoj.solaris
0 Replies

4. Shell Programming and Scripting

Cron jobs and mail

Hi, I am new to this mail concept and cran jobs,i have given with a task to send a mail for every one hour from unix to my outlook by checking some sanitry checks kindly look the below queires and help me in this 1.)How to send a mail from unix box to outlook. 2.)I assigned to check a... (4 Replies)
Discussion started by: thelakbe
4 Replies

5. Solaris

no mail after cron

Hi All, My current version is 5.10 Generic_127127-11, I'm not getting mails after cron for single os user where as for others users im getting mail after cron. i've not found any mail file in /var/mail for that particular user, and i have created a new mail file. but no luck please... (1 Reply)
Discussion started by: adeel_dba
1 Replies

6. What is on Your Mind?

Unix Administrator and Linux Administrator transition

Hello Unix Experts, I'm going to be graduating with a CIS (Computer Information Systems) degree in the coming year. I have been offered an internship with a job title of Unix Administrator under a well known company. I understand that Unix is used for high-end servers in many large... (1 Reply)
Discussion started by: brentmd24
1 Replies

7. Solaris

Mail is not sent by cron daemon

Hello All, In SunOS 10, I have some cron jobs and it is running fine but the cron job outputs are not mailing to any acount of the system. In other OS, we have option like MAILTO variable or /dev/null to disable but in Sun I have no idea how it is disabled by default and how do I... (13 Replies)
Discussion started by: Tlogine
13 Replies

8. UNIX for Dummies Questions & Answers

Process mail using cron

I am looking for information on how to process mail using a cron job. The email server is a hosted ISP, so I simply have a POP connection to the mailbox. Specifically, I want to fire a cron job at {x} time and have pine, mail, mailx, or some other suitable mail client utility process the... (1 Reply)
Discussion started by: EOD
1 Replies

9. UNIX for Advanced & Expert Users

stopping cron temporarly for weekend maintenance

I need to do some DB maintenance, but there are cron jobs running all weekend. How do I stop the cron jobs (that I see when I do a crontab -l) for the weekend then restart the cron jobs. My understanding is that when the system is startted cron jobs in the /usr/spool/cron/crontabs folder are... (2 Replies)
Discussion started by: cjcamaro
2 Replies
Login or Register to Ask a Question