<?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: How to do Error Email if there is a Problem w/Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-error-email-if-there-is-a-problem-w-script/m-p/2529105#M728664</link>
    <description>Hi Laurie,&lt;BR /&gt;&lt;BR /&gt;I happened to have a script that was extremely close so I added your emailing; it's commented out but remove the comments, set the proper addressee (ADDRESS). You will need to also set the variables GROUP and OWNER to change the ownerships of the remote files. The source and destination arrays will need to be set to your desired files. One improvement that I'll leave an an exercise for the reader is to determine the owner and group of the local file and use that data to set the values on the destination machine 'on the fly'. You may also need to add some PATH exports to run under cron.&lt;BR /&gt;Please see the attachment. &lt;BR /&gt;&lt;BR /&gt;Clay&lt;BR /&gt;</description>
    <pubDate>Wed, 16 May 2001 14:22:22 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2001-05-16T14:22:22Z</dc:date>
    <item>
      <title>How to do Error Email if there is a Problem w/Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-error-email-if-there-is-a-problem-w-script/m-p/2529103#M728662</link>
      <description>Hi Virtual Friends,&lt;BR /&gt;&lt;BR /&gt;My scripted worked great with the remote copy&lt;BR /&gt;thank you for you help.&lt;BR /&gt;&lt;BR /&gt;I have it setup in cron to run at 4am every&lt;BR /&gt;day.  However I have two questions.&lt;BR /&gt;&lt;BR /&gt;1. Will it just copy over files on the target&lt;BR /&gt;with existing names?  I want it to over&lt;BR /&gt;write with the new source file, so hopefully&lt;BR /&gt;the answer is yes.&lt;BR /&gt;&lt;BR /&gt;2. How do I add some error checking like&lt;BR /&gt;syserr to my script below, do I add the email&lt;BR /&gt;to my cron job???:&lt;BR /&gt;&lt;BR /&gt;FILES="/db21/backup/*.gz /db22/backup/*.gz  /db23/backup/*.gz "&lt;BR /&gt;&lt;BR /&gt;Here's my script:&lt;BR /&gt;for FILE in ${FILES}&lt;BR /&gt;do&lt;BR /&gt;rcp -p ${FILE} naropa:${FILE}&lt;BR /&gt;remsh naropa chown syb115:syb115 $FILE&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Here's my cron:&lt;BR /&gt;0 4 * * * /var/adm/backup 2&amp;gt; /dev/null&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;~&lt;BR /&gt;</description>
      <pubDate>Wed, 16 May 2001 14:01:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-error-email-if-there-is-a-problem-w-script/m-p/2529103#M728662</guid>
      <dc:creator>Laurie A. Krumrey</dc:creator>
      <dc:date>2001-05-16T14:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Error Email if there is a Problem w/Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-error-email-if-there-is-a-problem-w-script/m-p/2529104#M728663</link>
      <description>0 4 * * * /var/adm/backup &amp;gt;ctrl.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;add if&amp;gt;then&amp;gt;else in your script for ctrl.log and if you have errors sen email with mailx or sendmail.</description>
      <pubDate>Wed, 16 May 2001 14:12:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-error-email-if-there-is-a-problem-w-script/m-p/2529104#M728663</guid>
      <dc:creator>Vincenzo Restuccia</dc:creator>
      <dc:date>2001-05-16T14:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Error Email if there is a Problem w/Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-error-email-if-there-is-a-problem-w-script/m-p/2529105#M728664</link>
      <description>Hi Laurie,&lt;BR /&gt;&lt;BR /&gt;I happened to have a script that was extremely close so I added your emailing; it's commented out but remove the comments, set the proper addressee (ADDRESS). You will need to also set the variables GROUP and OWNER to change the ownerships of the remote files. The source and destination arrays will need to be set to your desired files. One improvement that I'll leave an an exercise for the reader is to determine the owner and group of the local file and use that data to set the values on the destination machine 'on the fly'. You may also need to add some PATH exports to run under cron.&lt;BR /&gt;Please see the attachment. &lt;BR /&gt;&lt;BR /&gt;Clay&lt;BR /&gt;</description>
      <pubDate>Wed, 16 May 2001 14:22:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-error-email-if-there-is-a-problem-w-script/m-p/2529105#M728664</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-05-16T14:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Error Email if there is a Problem w/Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-error-email-if-there-is-a-problem-w-script/m-p/2529106#M728665</link>
      <description>Oops, Laurie add an 'fi' after the echo | email statement.&lt;BR /&gt;&lt;BR /&gt;Sorry, Clay&lt;BR /&gt;</description>
      <pubDate>Wed, 16 May 2001 14:30:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-error-email-if-there-is-a-problem-w-script/m-p/2529106#M728665</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-05-16T14:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Error Email if there is a Problem w/Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-error-email-if-there-is-a-problem-w-script/m-p/2529107#M728666</link>
      <description>You could also use || or &amp;amp;&amp;amp; &lt;BR /&gt;&lt;BR /&gt;||(pipepipe) if first did not work do second&lt;BR /&gt;&amp;amp;&amp;amp; if first did work do second&lt;BR /&gt;&lt;BR /&gt;example:&lt;BR /&gt;&lt;BR /&gt;rcp -p ${FILE} naropa:${FILE} || echo "Files did not go" | mailx ............ &lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;rcp -p ${FILE} naropa:${FILE} &amp;amp;&amp;amp; echo "Files did go" | mailx .........&lt;BR /&gt;&lt;BR /&gt;Hope this helps...&lt;BR /&gt;&lt;BR /&gt;...jcd...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 16 May 2001 15:59:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-error-email-if-there-is-a-problem-w-script/m-p/2529107#M728666</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-05-16T15:59:30Z</dc:date>
    </item>
  </channel>
</rss>

