<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cron in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/4584174#M650764</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;A 'crontab' job will generate a mail to the controlling account whenever *either* STDOUT or STDERR is produced and the output isn't redirected.&lt;BR /&gt;&lt;BR /&gt;Well-behaved processes (and scripts) produce their desired output to STDOUT and any warnings or errors to STDERR.  Thus, if this were the case for your process, you could suppress mail generation, except for error conditions, with:&lt;BR /&gt;&lt;BR /&gt;# /usr/local/bin/mything &amp;gt; /var/tmp/mything.log&lt;BR /&gt;&lt;BR /&gt;...assuming that if there is a warning or error, that information would be written to the un-redirected STDERR which would then trigger a mail event under 'cron'.&lt;BR /&gt;&lt;BR /&gt;The success or failure of a process as cataloged in its return code has nothing to do with weather or not STDERR (or for that matter, STDOUT) might be written.  You need to know what rules your process follows.  &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Mon, 15 Feb 2010 20:48:24 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2010-02-15T20:48:24Z</dc:date>
    <item>
      <title>Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/4584170#M650760</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;I need find a solution for cron tasks y need send a email when some tasks fail only when fail &lt;BR /&gt;&lt;BR /&gt;someone see this case&lt;BR /&gt;&lt;BR /&gt;thks</description>
      <pubDate>Mon, 15 Feb 2010 15:58:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/4584170#M650760</guid>
      <dc:creator>Isaac_4</dc:creator>
      <dc:date>2010-02-15T15:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/4584171#M650761</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;check this link :&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.unix.com/unix-dummies-questions-answers/5127-email-when-cron-fails.html" target="_blank"&gt;http://www.unix.com/unix-dummies-questions-answers/5127-email-when-cron-fails.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;mikap</description>
      <pubDate>Mon, 15 Feb 2010 16:06:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/4584171#M650761</guid>
      <dc:creator>Michal Kapalka (mikap)</dc:creator>
      <dc:date>2010-02-15T16:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/4584172#M650762</link>
      <description>&lt;!--!*#--&gt;Shalom,&lt;BR /&gt;&lt;BR /&gt;This needs to be handled inside the cron script.&lt;BR /&gt;&lt;BR /&gt;cron itself can email not at all, or every time the script runs.&lt;BR /&gt;&lt;BR /&gt;So build this into the script cron calls:&lt;BR /&gt;&lt;BR /&gt;&lt;IMPORTANT command="" process=""&gt;&lt;BR /&gt;# Get the return code from the important process&lt;BR /&gt;rc=$?&lt;BR /&gt;#&lt;BR /&gt;if [ $rc -eq 0 ]&lt;BR /&gt;then&lt;BR /&gt;   echo "Process succeeded"&lt;BR /&gt;else&lt;BR /&gt;   echo "Process failed | mailx -s "Job blah blah failed" yourmailbox@yourdomain.com&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;SEP&lt;/IMPORTANT&gt;</description>
      <pubDate>Mon, 15 Feb 2010 16:25:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/4584172#M650762</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2010-02-15T16:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/4584173#M650763</link>
      <description>But if used  in my script the default  error exit , that i believe its  "/sbin/myscript 2&amp;gt; mailx -s "" "" etc.  can work that ?</description>
      <pubDate>Mon, 15 Feb 2010 17:00:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/4584173#M650763</guid>
      <dc:creator>Isaac_4</dc:creator>
      <dc:date>2010-02-15T17:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/4584174#M650764</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;A 'crontab' job will generate a mail to the controlling account whenever *either* STDOUT or STDERR is produced and the output isn't redirected.&lt;BR /&gt;&lt;BR /&gt;Well-behaved processes (and scripts) produce their desired output to STDOUT and any warnings or errors to STDERR.  Thus, if this were the case for your process, you could suppress mail generation, except for error conditions, with:&lt;BR /&gt;&lt;BR /&gt;# /usr/local/bin/mything &amp;gt; /var/tmp/mything.log&lt;BR /&gt;&lt;BR /&gt;...assuming that if there is a warning or error, that information would be written to the un-redirected STDERR which would then trigger a mail event under 'cron'.&lt;BR /&gt;&lt;BR /&gt;The success or failure of a process as cataloged in its return code has nothing to do with weather or not STDERR (or for that matter, STDOUT) might be written.  You need to know what rules your process follows.  &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 15 Feb 2010 20:48:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/4584174#M650764</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-02-15T20:48:24Z</dc:date>
    </item>
  </channel>
</rss>

