[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cron and MAILTO



Thanks for your answer Bob.

On Sun, 18 Dec 2011 21:38:05 -0700, Bob Proulx wrote:

>> I know normally cron will send emails to whoever the job is owned/
>> launched by, but if I put a MAILTO at the top of the file, will all
>> emails be then sent to my designated MAILTO user id, instead of to
>> different users that own/launch the jobs?
> 
> Yes.  That is a Vixie cron specific feature.  It does not exist in
> either the old System V or BSD cron daemons.

Hmm... I'm still not too sure what you meant.

Let me explain with an example. 

Say I have a file under /etc/cron.d/ with the following entry:

42 4 1 * * user1 echo "This command is run 4:42 am every 1st of the month"
01 * 19 07 * user2 echo "This command is run hourly on the 19th of July"

Usually, when the jobs do get fired up, each user receives the 
corresponding message in their email. 

Now, if I put 'MAILTO=user3' at the top of the file, what will happen? 

Thanks

-- 
Tong (remove underscore(s) to reply)
  http://xpt.sourceforge.net/techdocs/
  http://xpt.sourceforge.net/tools/


Reply to: