<?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: Script question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243949#M174136</link>
    <description>Hi,&lt;BR /&gt;The correct solution is to run&lt;BR /&gt;touch /tmp/daily_prod_2_ult&lt;BR /&gt;&lt;BR /&gt;as a post_exec script in the &lt;BR /&gt;&lt;BR /&gt;Daily_PROD_2_ULT &lt;BR /&gt;&lt;BR /&gt;datalist&lt;BR /&gt;</description>
    <pubDate>Thu, 08 Apr 2004 14:11:49 GMT</pubDate>
    <dc:creator>Leif Halvarsson_2</dc:creator>
    <dc:date>2004-04-08T14:11:49Z</dc:date>
    <item>
      <title>Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243945#M174132</link>
      <description>Good morning admins.  Have a quick questions regarding the following script:&lt;BR /&gt;# begin script&lt;BR /&gt;PATH=/sbin:/usr/sbin:/usr/bin:/opt/omni/lbin:/opt/omni/bin&lt;BR /&gt;export PATH&lt;BR /&gt;&lt;BR /&gt;if [ $SMEXIT != 0 ]&lt;BR /&gt;then&lt;BR /&gt;/opt/omni/lbin/backuperr&lt;BR /&gt;&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;else&lt;BR /&gt; echo "Successful Backup"&lt;BR /&gt; echo "Now submitting Daily_PROD_2_ULT backup run."&lt;BR /&gt;     omnib -datalist Daily_PROD_2_ULT -no_monitor&lt;BR /&gt;     touch /tmp/daily_prod_2_ult&lt;BR /&gt;     echo `date` &amp;gt;&amp;gt; /tmp/daily_prod_2_ult&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo "${progname} completed!"&lt;BR /&gt;&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Would like to have the omnidb process complete before the file is touched, in effect have the script suspend until the Omniback backup is complete, once the backup is complete then have the file created.  THankyou in advance for input.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Apr 2004 12:26:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243945#M174132</guid>
      <dc:creator>wvsa</dc:creator>
      <dc:date>2004-04-08T12:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243946#M174133</link>
      <description>omnib surely starts backup in background.&lt;BR /&gt;you should use wait to be sure omnib is finished.&lt;BR /&gt;&lt;BR /&gt;Try to look how this can be merged in your script (might be better with awk, but...)&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;nohup sleep 5 &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&lt;BR /&gt;SleepPID=`ps -edf | grep "sleep 5" | \&lt;BR /&gt;  grep -v grep | tr "[:blank:]" " " | \&lt;BR /&gt;  sed "s/  */ /" | cut -d " " -f 3`&lt;BR /&gt;wait $SleepPID&lt;BR /&gt;echo I waited for sleep to finish&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Apr 2004 13:03:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243946#M174133</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-04-08T13:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243947#M174134</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;  # begin script&lt;BR /&gt;PATH=/sbin:/usr/sbin:/usr/bin:/opt/omni/lbin:/opt/omni/bin&lt;BR /&gt;export PATH&lt;BR /&gt;&lt;BR /&gt;if [ $SMEXIT != 0 ]&lt;BR /&gt;then&lt;BR /&gt;/opt/omni/lbin/backuperr&lt;BR /&gt;&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;else&lt;BR /&gt;echo "Successful Backup"&lt;BR /&gt;echo "Now submitting Daily_PROD_2_ULT backup run."&lt;BR /&gt;omnib -datalist Daily_PROD_2_ULT -no_monitor&lt;BR /&gt;wait&lt;BR /&gt;touch /tmp/daily_prod_2_ult&lt;BR /&gt;echo `date` &amp;gt;&amp;gt; /tmp/daily_prod_2_ult&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo "${progname} completed!"&lt;BR /&gt;&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;  I am not sure if this will work  - but try it out.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sundar</description>
      <pubDate>Thu, 08 Apr 2004 13:08:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243947#M174134</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-04-08T13:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243948#M174135</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You can remove the no_moitor option and check for RC and if you get a RC=0 then touch the file, else exit.&lt;BR /&gt;&lt;BR /&gt;omnib -datalist Daily_PROD_2_ULT &lt;BR /&gt;if [ $rc = 0 ]&lt;BR /&gt;then&lt;BR /&gt;touch /tmp/daily_prod_2_ult&lt;BR /&gt;else &lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Apr 2004 13:15:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243948#M174135</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2004-04-08T13:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243949#M174136</link>
      <description>Hi,&lt;BR /&gt;The correct solution is to run&lt;BR /&gt;touch /tmp/daily_prod_2_ult&lt;BR /&gt;&lt;BR /&gt;as a post_exec script in the &lt;BR /&gt;&lt;BR /&gt;Daily_PROD_2_ULT &lt;BR /&gt;&lt;BR /&gt;datalist&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Apr 2004 14:11:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243949#M174136</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2004-04-08T14:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243950#M174137</link>
      <description>Change following code&lt;BR /&gt;else&lt;BR /&gt;echo "Successful Backup"&lt;BR /&gt;echo "Now submitting Daily_PROD_2_ULT backup run."&lt;BR /&gt;omnib -datalist Daily_PROD_2_ULT -no_monitor&lt;BR /&gt;touch /tmp/daily_prod_2_ult&lt;BR /&gt;echo `date` &amp;gt;&amp;gt; /tmp/daily_prod_2_ult&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;TO&lt;BR /&gt;&lt;BR /&gt;else&lt;BR /&gt;echo "Successful Backup"&lt;BR /&gt;echo "Now submitting Daily_PROD_2_ULT backup run."&lt;BR /&gt;omnib -datalist Daily_PROD_2_ULT -no_monitor &amp;amp;&amp;amp; touch /tmp/daily_prod_2_ult&lt;BR /&gt;echo `date` &amp;gt;&amp;gt; /tmp/daily_prod_2_ult&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;(See the use of &amp;amp;&amp;amp;)&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Thu, 08 Apr 2004 14:27:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243950#M174137</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-04-08T14:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243951#M174138</link>
      <description>Sorry,&lt;BR /&gt;I noticed that your script is a post_exec script (the SMEXIT variable) and you want to start a another backup from that script (consecutive backup).&lt;BR /&gt;&lt;BR /&gt;You could use a post_exec script for the second backup which do the: &lt;BR /&gt;if [ $SMEXIT = 0 ]&lt;BR /&gt;then&lt;BR /&gt;touch /tmp/daily_prod_2_ult&lt;BR /&gt;echo `date` &amp;gt;&amp;gt; /tmp/daily_prod_2_ult&lt;BR /&gt;&lt;BR /&gt;echo "${progname} completed!"&lt;BR /&gt;else&lt;BR /&gt;&lt;BR /&gt;........&lt;BR /&gt;&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Or you can use the same post_exec script for both jobs and use the variable&lt;BR /&gt;DATALIST&lt;BR /&gt;to chech which of the two jobs is runnnin and what should be done.</description>
      <pubDate>Thu, 08 Apr 2004 14:36:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243951#M174138</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2004-04-08T14:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243952#M174139</link>
      <description>RAC, what does the &amp;amp;&amp;amp; do?  Could you provide a brief explanation?  Thankyou!!</description>
      <pubDate>Thu, 08 Apr 2004 14:38:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243952#M174139</guid>
      <dc:creator>wvsa</dc:creator>
      <dc:date>2004-04-08T14:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243953#M174140</link>
      <description>"Execute upon successful completion of the previous task", as against || which is "Execute upon un-successful completion of previous task".&lt;BR /&gt;&lt;BR /&gt;If the previous task is backgrounding off however, then it won't be much help, as the return is still immediate.</description>
      <pubDate>Thu, 08 Apr 2004 18:15:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3243953#M174140</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2004-04-08T18:15:16Z</dc:date>
    </item>
  </channel>
</rss>

