[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Sat, 15 Oct 2005 09:47:17 -0400 -->
- <!--x-from-r13: rfbgrevp ng 3gvzrf25.arg (Urbsserl) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] -->
- <!--x-reference: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] cron mail, how to STOP it. -->
- <li><em>date</em>: Sat, 15 Oct 2005 09:47:17 -0400</li>
- <li><em>from</em>: esoteric at 3times25.net (Geoffrey)</li>
- <li><em>in-reply-to</em>: <<a href="msg00374.html">[email protected]</a>></li>
- <li><em>references</em>: <<a href="msg00357.html">[email protected]</a>> <<a href="msg00369.html">[email protected]</a>> <<a href="msg00374.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] cron mail, how to STOP it.</li>
I would disagree. MAILTO works, I agree. But, if there is no output
produced by the script, no mail goes out.
For example, the following cron entry says email, both stdout of the
'date' command and the stderr of the non-existen 'dte' command to my email:
* * * * * date ;dte
However, the following executes without sending any email:
* * * * * date > /dev/null ;dte 2>/dev/null
> Of course this brings up the obvious, "What if I want _some_ crons to
> notify me and other to not waste my time?"
> Tough cookies. It's an all or nothing deal. There are some other cron
> beside the standard Vixie cron that might support that. I have not used
> any of them. I use wrapper scripts that handle email notification for
> those jobs I need notification of and turned off the cron notification
> by default.
If you want the output, whether it be stderr or stdout to go elsewhere,
it can be redirected in the script:
exec 2>/tmp/stderr
exec >/tmp/stdout
or
exec 2>/dev/null
or other some such.
You can also created additional file descriptors in shell as such:
exec 3>/tmp/dateoutput
date >&3
The above works in both bash and ksh.
And of course you can redirect anything to the mail command from within
the script.
There are a lot of things you can do to control the output of a cron job.
--
Until later, Geoffrey
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00357" href="msg00357.html">[ale] cron mail, how to STOP it.</a></strong>
<ul><li><em>From:</em> paul_tbot at pcartwright.com (Paul Cartwright)</li></ul></li>
<li><strong><a name="00369" href="msg00369.html">[ale] cron mail, how to STOP it.</a></strong>
<ul><li><em>From:</em> esoteric at 3times25.net (Geoffrey)</li></ul></li>
<li><strong><a name="00374" href="msg00374.html">[ale] cron mail, how to STOP it.</a></strong>
<ul><li><em>From:</em> jkinney at localnetsolutions.com (James P. Kinney III)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00374.html">[ale] cron mail, how to STOP it.</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00376.html">[ale] cron mail, how to STOP it.</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00374.html">[ale] cron mail, how to STOP it.</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00376.html">[ale] cron mail, how to STOP it.</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00375"><strong>Date</strong></a></li>
<li><a href="threads.html#00375"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>