cron.daily, howto control mailed reports

2004-12-23 Thread Joao Clemente
Hi people.
In a server I setup recently I tougth of keeping the clock sinc'ed by 
running ntpdate daily. I wrote a script calling
/etc/init.d/ntpdate restart
and I placed it in /etc/cron.daily.

Why do I receive daily reports (in my mail system) from this particular 
script being runned, but not from other also existant in /etc/cron.daily?

Ps: I just notisted an report from another script that I'm running 
hourly.. but it seems to have only reported 1 time, when there was an 
output to stdout... can that be it? If there is something in stdout cron 
will report to the mail system, otherwise it will run silently?

Thanks
Joao Clemente
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: cron.daily, howto control mailed reports

2004-12-23 Thread Robert Vangel
set the MAILTO variable in the script
eg
#!/bin/bash
MAILTO=[EMAIL PROTECTED]
/etc/init.d/ntpdate restart
afaik, that would work.
Joao Clemente wrote:
Hi people.
In a server I setup recently I tougth of keeping the clock sinc'ed by 
running ntpdate daily. I wrote a script calling
/etc/init.d/ntpdate restart
and I placed it in /etc/cron.daily.

Why do I receive daily reports (in my mail system) from this particular 
script being runned, but not from other also existant in /etc/cron.daily?

Ps: I just notisted an report from another script that I'm running 
hourly.. but it seems to have only reported 1 time, when there was an 
output to stdout... can that be it? If there is something in stdout cron 
will report to the mail system, otherwise it will run silently?

Thanks
Joao Clemente



smime.p7s
Description: S/MIME Cryptographic Signature


Re: cron.daily, howto control mailed reports

2004-12-23 Thread Benjamin A'Lee
On Fri, Dec 24, 2004 at 02:22:10AM + or thereabouts, Joao Clemente wrote:
 Why do I receive daily reports (in my mail system) from this particular 
 script being runned, but not from other also existant in /etc/cron.daily?
 
If you want it to run silently, you can put MAILTO= in /etc/crontab
But otherwise cron jobs only mail if there's output to stdout, so if
you want more out put, not less, you'd have to set each one
individually (I think).

-- 
 -Benjamin Matthew A'Lee, currently trying to make sure Mutt doesn't
 let him accidentally reply to sender instead of reply to list...

Termisoc Secretary: http://www.termisoc.org/
Home Page: http://benalee.co.uk/
Public Key: BEC9DC1A
The right to bear arms is only slightly less silly 
  than the right to arm bears.


signature.asc
Description: Digital signature


Re: cron.daily, howto control mailed reports

2004-12-23 Thread Robert Vangel
Sorry, ignore mine. I completely misread the question :\
Robert Vangel wrote:
set the MAILTO variable in the script
eg
#!/bin/bash
MAILTO=[EMAIL PROTECTED]
/etc/init.d/ntpdate restart
afaik, that would work.
Joao Clemente wrote:
Hi people.
In a server I setup recently I tougth of keeping the clock sinc'ed by 
running ntpdate daily. I wrote a script calling
/etc/init.d/ntpdate restart
and I placed it in /etc/cron.daily.

Why do I receive daily reports (in my mail system) from this 
particular script being runned, but not from other also existant in 
/etc/cron.daily?

Ps: I just notisted an report from another script that I'm running 
hourly.. but it seems to have only reported 1 time, when there was an 
output to stdout... can that be it? If there is something in stdout 
cron will report to the mail system, otherwise it will run silently?

Thanks
Joao Clemente



smime.p7s
Description: S/MIME Cryptographic Signature


Re: cron.daily, howto control mailed reports

2004-12-23 Thread Joao Clemente
Benjamin A'Lee wrote:
On Fri, Dec 24, 2004 at 02:22:10AM + or thereabouts, Joao Clemente wrote:
Why do I receive daily reports (in my mail system) from this particular 
script being runned, but not from other also existant in /etc/cron.daily?

If you want it to run silently, you can put MAILTO= in /etc/crontab
But otherwise cron jobs only mail if there's output to stdout, so if
you want more out put, not less, you'd have to set each one
individually (I think).
Thanks Benjamin, running silently was what I was looking for.
Robert: no problem, thanks for the answer anyway :-)
Joao Clemente
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: cron.daily, howto control mailed reports

2004-12-23 Thread Sam Watkins
On Fri, Dec 24, 2004 at 02:22:10AM +, Joao Clemente wrote:
 Why do I receive daily reports (in my mail system) from this particular 
 script being runned, but not from other also existant in /etc/cron.daily?

If any cron script outputs anything on stdout or stderr, the output is
emailed to you (according to MAILTO).  The standard cron scripts don't
output anything unless something goes wrong (e.g. you type killall
updatedb while it's running).  Your ntp script will output stuff even
when it goes right, hence the message.

You should do something like:

  ntpdate -s pool.ntp.org

the -s puts the messages in syslog instead of stdout,
to quote the manpage, primarily for convenience of cron scripts

(speaking of which, my ntpdate script obviously isn't working,
my clock was wrong again!)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]