<?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: Disabling the message generation out of cronjobs in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936598#M410947</link>
    <description>At the end of your cron entry, add "1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1" (without the quotes).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
    <pubDate>Wed, 26 Oct 2005 09:56:05 GMT</pubDate>
    <dc:creator>Pete Randall</dc:creator>
    <dc:date>2005-10-26T09:56:05Z</dc:date>
    <item>
      <title>Disabling the message generation out of cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936597#M410946</link>
      <description>HI&lt;BR /&gt;whenever I run a cronjob, it generates an email and sends it to inform it has been run. Is there a way to disable the notification when a cronjob runs based on some conditions</description>
      <pubDate>Wed, 26 Oct 2005 09:50:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936597#M410946</guid>
      <dc:creator>sarma</dc:creator>
      <dc:date>2005-10-26T09:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling the message generation out of cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936598#M410947</link>
      <description>At the end of your cron entry, add "1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1" (without the quotes).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Wed, 26 Oct 2005 09:56:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936598#M410947</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2005-10-26T09:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling the message generation out of cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936599#M410948</link>
      <description>The most common reason for email generated by cron is the handling of stdout &amp;amp; stderr.  It's wise to redirect the output of a cron command to log files or at the very least to /dev/null as in &lt;BR /&gt;&lt;BR /&gt;&amp;gt; /dev/null 2&amp;gt;&amp;amp;1</description>
      <pubDate>Wed, 26 Oct 2005 09:57:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936599#M410948</guid>
      <dc:creator>Alan Meyer_4</dc:creator>
      <dc:date>2005-10-26T09:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling the message generation out of cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936600#M410949</link>
      <description>Oops, extraneous 1 in there - do it like Alan wrote it!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Wed, 26 Oct 2005 09:58:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936600#M410949</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2005-10-26T09:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling the message generation out of cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936601#M410950</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Any output (STDOUT or STDERR) generated by a crontask that is not redirected to a file will be emailed to the user that submitted the job.  This can be quite useful as an exception reporting mechanism, especially for STDERR when your scripts are "properly" written.&lt;BR /&gt;&lt;BR /&gt;In any case, if you do not want the un-redirected output, do something like:&lt;BR /&gt;&lt;BR /&gt;0 1 * * * /path/scrript &amp;gt; /dev/null #...discard STDOUT&lt;BR /&gt;&lt;BR /&gt;0 1 * * * /path/script &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 #...discard STDOUT + STDERR&lt;BR /&gt;&lt;BR /&gt;Another way to circumvent the problem is to write your scripts to determine whether or not they have a controlling terminal.  Since 'cron' jobs don't, you can begin your script with:&lt;BR /&gt;&lt;BR /&gt;[ -t 0 ] || exec &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 26 Oct 2005 10:05:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936601#M410950</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-10-26T10:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling the message generation out of cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936602#M410951</link>
      <description>You received a mail not because the job was run, but because the job had output and could not be displayed. That's why you need to redirect stdout and stderr in the scripts. But instead of discard the output, can be recommended to redirect the output to a logfile, if the job cannot run for some reason, you can check the log file.&lt;BR /&gt;&lt;BR /&gt;Like&lt;BR /&gt;&lt;BR /&gt;0 * * * * /usr/local/bin/myscript.sh &amp;gt; /tmp/myscript.log 2&amp;gt;&amp;amp;1</description>
      <pubDate>Wed, 26 Oct 2005 10:28:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936602#M410951</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2005-10-26T10:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling the message generation out of cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936603#M410952</link>
      <description>Like Ivan, I tend to send output of cron to a log file - unless I don't need the info.&lt;BR /&gt;&lt;BR /&gt;Examples:&lt;BR /&gt;&lt;BR /&gt;0 5 * * 1 [ -d /var/adm/lp/XEBEC ] &amp;amp;&amp;amp; /usr/local/bin/print.clean.receive &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;0 6 21 * * [ -d /var/adm/lp/XEBEC ] &amp;amp;&amp;amp; /usr/local/bin/lpqpurge &amp;gt;/tmp/lpqpurge.cronlog 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Oct 2005 12:08:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936603#M410952</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-10-26T12:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling the message generation out of cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936604#M410953</link>
      <description>thank you for the information</description>
      <pubDate>Wed, 26 Oct 2005 13:58:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disabling-the-message-generation-out-of-cronjobs/m-p/4936604#M410953</guid>
      <dc:creator>sarma</dc:creator>
      <dc:date>2005-10-26T13:58:05Z</dc:date>
    </item>
  </channel>
</rss>

