<?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 script - unwanted e-mail generated in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/cron-script-unwanted-e-mail-generated/m-p/4573580#M39491</link>
    <description>Raynald&lt;BR /&gt;&lt;BR /&gt;What is the function of this script?  If you have a find statement within the script, then you should error-check and send an alerting email from the script itself.  Why not post it here and we can make suggestions?  You can obviously trap your script output to something else other than /dev/null, say for example:&lt;BR /&gt;&lt;BR /&gt;0-59/5 * * * 0-6 /u01/oracle/SCRIPTS/copy_archivelogs_to_nbcseprd_DR.sh &amp;gt;&amp;gt;/tmp/script.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;but you will then need another script to monitor your logfile (/tmp/script.log in this example).  You can set a non-zero exit code when the script fails (on completion) and this return code is stored in the cron log, but again, you need another script to detect/monitor this.&lt;BR /&gt;&lt;BR /&gt;All the best - Keith</description>
    <pubDate>Thu, 28 Jan 2010 23:34:41 GMT</pubDate>
    <dc:creator>Keith Bryson</dc:creator>
    <dc:date>2010-01-28T23:34:41Z</dc:date>
    <item>
      <title>cron script - unwanted e-mail generated</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-script-unwanted-e-mail-generated/m-p/4573577#M39488</link>
      <description>Hello all,&lt;BR /&gt;&lt;BR /&gt;I have this little script that is triggered by oracle's crontab on a redhat virtual server.  The script works fine because I can verify results but it generates a Mail message every time it runs.  I want to eliminate the Mail messages.&lt;BR /&gt;&lt;BR /&gt;The following crontab entry was created by "crontab -e" as the oracle user:&lt;BR /&gt;"0-59/5 * * * 0-6 /u01/oracle/SCRIPTS/copy_archivelogs_to_nbcseprd_DR.sh &amp;gt; /dev/null"&lt;BR /&gt;&lt;BR /&gt;The Mail message looks like:&lt;BR /&gt;Message 61:&lt;BR /&gt;From oracle@db13.xxx.ca  Thu Jan 28 04:30:02 2010&lt;BR /&gt;Date: Thu, 28 Jan 2010 04:30:01 -0400&lt;BR /&gt;From: root@db13.xxx.ca (Cron Daemon)&lt;BR /&gt;To: oracle@db13.xxx.ca&lt;BR /&gt;Subject: Cron &lt;ORACLE&gt; /u01/oracle/SCRIPTS/copy_archive&lt;BR /&gt;logs_to_nbcseprd_DR.sh &amp;gt; /dev/null&lt;BR /&gt;Content-Type: text/plain; charset=UTF-8&lt;BR /&gt;Auto-Submitted: auto-generated&lt;BR /&gt;X-Cron-Env: &lt;SHELL&gt;&lt;BR /&gt;X-Cron-Env: &lt;HOME&gt;&lt;BR /&gt;X-Cron-Env: &lt;PATH&gt;&lt;BR /&gt;X-Cron-Env: &lt;LOGNAME&gt;&lt;BR /&gt;X-Cron-Env: &lt;USER&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;&amp;lt;&lt;THIS system="" is="" to="" be="" used="" only="" by="" authorized="" clients.="" by="" continuing="" to="" use=""&gt;&lt;/THIS&gt;the system, the client represents that he or she is an authorized client.&lt;BR /&gt;&lt;BR /&gt;Ce systeme ne doit etre utilise par des clients autorises.  En continuant&lt;BR /&gt;d'utiliser le systeme, le client affirme qu'il est un client autorise.&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;&lt;BR /&gt;where the text that is shown between the &amp;lt;&amp;lt;&amp;lt; and &amp;gt;&amp;gt;&amp;gt; is the contents of the /etc/issue file that is displayed at logon time.&lt;BR /&gt;&lt;BR /&gt;Questions:&lt;BR /&gt;1- Is the message generated by :cron: or by the :sh: command that is executed on the :find: command output?&lt;BR /&gt;&lt;BR /&gt;2- How can I get rid of that mail message?&lt;BR /&gt;I still want to know if the script failed.&lt;BR /&gt;&lt;BR /&gt;3- Can someone clearly explain the -exec constuct found in the :find: command?&lt;BR /&gt;I know it moves files to the MOVED_TO_DR but I have no idea where the "find-copy" comes from and what the + means.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Rayb&lt;/USER&gt;&lt;/LOGNAME&gt;&lt;/PATH&gt;&lt;/HOME&gt;&lt;/SHELL&gt;&lt;/ORACLE&gt;</description>
      <pubDate>Thu, 28 Jan 2010 18:49:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-script-unwanted-e-mail-generated/m-p/4573577#M39488</guid>
      <dc:creator>Raynald Boucher</dc:creator>
      <dc:date>2010-01-28T18:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: cron script - unwanted e-mail generated</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-script-unwanted-e-mail-generated/m-p/4573578#M39489</link>
      <description>Hi Raynald&lt;BR /&gt;&lt;BR /&gt;try the following:&lt;BR /&gt;0-59/5 * * * 0-6 /u01/oracle/SCRIPTS/copy_archivelogs_to_nbcseprd_DR.sh &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;This ensures that all output (stdout/stderr) goes to dev/null.&lt;BR /&gt;&lt;BR /&gt;Hope that helps&lt;BR /&gt;Keith</description>
      <pubDate>Thu, 28 Jan 2010 19:30:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-script-unwanted-e-mail-generated/m-p/4573578#M39489</guid>
      <dc:creator>Keith Bryson</dc:creator>
      <dc:date>2010-01-28T19:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: cron script - unwanted e-mail generated</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-script-unwanted-e-mail-generated/m-p/4573579#M39490</link>
      <description>I thought about that but I wish to get mail when the script fails.&lt;BR /&gt;Won't that defeat that purpose?</description>
      <pubDate>Thu, 28 Jan 2010 19:43:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-script-unwanted-e-mail-generated/m-p/4573579#M39490</guid>
      <dc:creator>Raynald Boucher</dc:creator>
      <dc:date>2010-01-28T19:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: cron script - unwanted e-mail generated</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-script-unwanted-e-mail-generated/m-p/4573580#M39491</link>
      <description>Raynald&lt;BR /&gt;&lt;BR /&gt;What is the function of this script?  If you have a find statement within the script, then you should error-check and send an alerting email from the script itself.  Why not post it here and we can make suggestions?  You can obviously trap your script output to something else other than /dev/null, say for example:&lt;BR /&gt;&lt;BR /&gt;0-59/5 * * * 0-6 /u01/oracle/SCRIPTS/copy_archivelogs_to_nbcseprd_DR.sh &amp;gt;&amp;gt;/tmp/script.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;but you will then need another script to monitor your logfile (/tmp/script.log in this example).  You can set a non-zero exit code when the script fails (on completion) and this return code is stored in the cron log, but again, you need another script to detect/monitor this.&lt;BR /&gt;&lt;BR /&gt;All the best - Keith</description>
      <pubDate>Thu, 28 Jan 2010 23:34:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-script-unwanted-e-mail-generated/m-p/4573580#M39491</guid>
      <dc:creator>Keith Bryson</dc:creator>
      <dc:date>2010-01-28T23:34:41Z</dc:date>
    </item>
  </channel>
</rss>

