<?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: Scripting help! in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084413#M143367</link>
    <description>O.K..&lt;BR /&gt;&lt;BR /&gt;Its late in the day here.....And I'm losing it.&lt;BR /&gt;&lt;BR /&gt;PS_ID=`ps -ef | grep &amp;lt;scripta&amp;gt; | awk '{print $2}'`&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;MYTEST=`ps -p $PS_ID`&lt;BR /&gt;if [ "$MYTEST" = "" ]&lt;BR /&gt;then&lt;BR /&gt;    exit&lt;BR /&gt;fi&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;James</description>
    <pubDate>Thu, 02 Oct 2003 15:15:15 GMT</pubDate>
    <dc:creator>James Randall</dc:creator>
    <dc:date>2003-10-02T15:15:15Z</dc:date>
    <item>
      <title>Scripting help!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084406#M143360</link>
      <description>I am having problems trying to figure out how to do this...&lt;BR /&gt;&lt;BR /&gt;We currently have a script (scripta) that runs from 6am till midnight and never terminates within that time... Once it is run, it constantly outputs data to a log file to monitor transactions...&lt;BR /&gt;&lt;BR /&gt;The problem is this script will periodically hang and then the transacations are not viewable via a custom app.  &lt;BR /&gt;&lt;BR /&gt;So I have written a script (scriptb) that monitors the date stamp on the log file and compares it to the actual time every 30 minutes.  If the time difference is more than 30 minutes, my script (scriptb) runs the restart command for (scripta)  And continues monitoring...&lt;BR /&gt;&lt;BR /&gt;The problem is since scripta never terminates, my script just sits there... Of course, waiting to continue when scripta finishes...&lt;BR /&gt;&lt;BR /&gt;Hope this doesn't sound too complicating...  Here is the output of my script when it resets and when there is not problem if it helps...&lt;BR /&gt;&lt;BR /&gt;       DATE STAMP             USER_QUERY      &lt;BR /&gt;         06:00                  06:00 &lt;BR /&gt;         06:31                  06:00&lt;BR /&gt;         07:01                  06:00&lt;BR /&gt;Wed Oct  1 07:01:09 CDT 2003&lt;BR /&gt;User Query log file is more than a half an hour old!&lt;BR /&gt;Time = 0701, User_Query = 0600&lt;BR /&gt;Time Difference = 101&lt;BR /&gt;Starting the kill_user_query script&lt;BR /&gt;Done!&lt;BR /&gt;Starting the start_user_query script&lt;BR /&gt;&lt;BR /&gt;Here is the script results when there are no problems:&lt;BR /&gt;&lt;BR /&gt;       DATE STAMP             USER_QUERY      &lt;BR /&gt;         06:00                  06:00 &lt;BR /&gt;         06:31                  06:00&lt;BR /&gt;         07:01                  06:00&lt;BR /&gt;  07:31   07:31&lt;BR /&gt;  08:00   08:00&lt;BR /&gt;  08:31   08:31&lt;BR /&gt;  09:00   09:00&lt;BR /&gt;  09:31   09:31&lt;BR /&gt;  10:00   10:00&lt;BR /&gt;  10:31   10:31&lt;BR /&gt;  11:00   11:00&lt;BR /&gt;  11:31   11:31&lt;BR /&gt;  12:00   12:00&lt;BR /&gt;  12:31    12:31&lt;BR /&gt;  13:00   13:00&lt;BR /&gt;  13:31   13:31&lt;BR /&gt;  14:00   14:00&lt;BR /&gt;  14:31   14:31&lt;BR /&gt;  15:00   15:00&lt;BR /&gt;  15:31   15:31&lt;BR /&gt;  16:00   16:00&lt;BR /&gt;  16:31   16:31&lt;BR /&gt;  17:00   17:00&lt;BR /&gt;  17:31   17:31&lt;BR /&gt;  18:00   18:00&lt;BR /&gt;  18:31   18:31&lt;BR /&gt;  19:00   19:00&lt;BR /&gt;  19:31   19:31&lt;BR /&gt;  20:00   20:00&lt;BR /&gt;  21:31   21:31&lt;BR /&gt;  22:00   22:00&lt;BR /&gt;  22:31   22:31&lt;BR /&gt;  23:00   23:00&lt;BR /&gt;  23:31   23:31</description>
      <pubDate>Thu, 02 Oct 2003 14:07:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084406#M143360</guid>
      <dc:creator>William Mounsey</dc:creator>
      <dc:date>2003-10-02T14:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084407#M143361</link>
      <description>My answer to this would be to have "scripta" dump its PID into a file.&lt;BR /&gt;&lt;BR /&gt;"scriptb" could then do a "ps -p `cat &lt;FILE&gt;`"....When that test come up empty...The script has finished...and "scriptb" can now quit.&lt;BR /&gt;&lt;BR /&gt;James&lt;/FILE&gt;</description>
      <pubDate>Thu, 02 Oct 2003 14:10:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084407#M143361</guid>
      <dc:creator>James Randall</dc:creator>
      <dc:date>2003-10-02T14:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084408#M143362</link>
      <description>I'd be interested in seeing scripta.  It would be better to discover why it is hanging.  Throwing programs at a program to fix the original program is dizzing!&lt;BR /&gt;&lt;BR /&gt;--Jim&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Oct 2003 14:10:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084408#M143362</guid>
      <dc:creator>James Specht</dc:creator>
      <dc:date>2003-10-02T14:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084409#M143363</link>
      <description>I totally agree... Find out why it is hanging, but it turns out that we outsourced the writing of some software and this is one small portion...  And my predecessors have spent many a waking hours trying to tie all the different variables together...&lt;BR /&gt;&lt;BR /&gt;The final outcome was lets watch it and when it hangs, restart it...&lt;BR /&gt;&lt;BR /&gt;And that is where I am at...</description>
      <pubDate>Thu, 02 Oct 2003 14:30:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084409#M143363</guid>
      <dc:creator>William Mounsey</dc:creator>
      <dc:date>2003-10-02T14:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084410#M143364</link>
      <description>And I didn't quite understand the ps -p thing...&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Oct 2003 14:33:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084410#M143364</guid>
      <dc:creator>William Mounsey</dc:creator>
      <dc:date>2003-10-02T14:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084411#M143365</link>
      <description>If you can get the process-id of the first script "scripta".....you can do the following in your loop.&lt;BR /&gt;&lt;BR /&gt;PS_ID=`ps -ef | grep &amp;lt;scripta&amp;gt;`&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;MYTEST=`ps -p $PS_ID`&lt;BR /&gt;if [ "$MYTEST" = "" ]&lt;BR /&gt;then&lt;BR /&gt;     exit&lt;BR /&gt;fi&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;James</description>
      <pubDate>Thu, 02 Oct 2003 15:11:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084411#M143365</guid>
      <dc:creator>James Randall</dc:creator>
      <dc:date>2003-10-02T15:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084412#M143366</link>
      <description>Opps..&lt;BR /&gt;&lt;BR /&gt;PS_ID=`ps -ef | grep &amp;lt;scripta&amp;gt; | awk '{print $1}'`&lt;BR /&gt;&lt;BR /&gt;and then the rest from above.&lt;BR /&gt;&lt;BR /&gt;James</description>
      <pubDate>Thu, 02 Oct 2003 15:12:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084412#M143366</guid>
      <dc:creator>James Randall</dc:creator>
      <dc:date>2003-10-02T15:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084413#M143367</link>
      <description>O.K..&lt;BR /&gt;&lt;BR /&gt;Its late in the day here.....And I'm losing it.&lt;BR /&gt;&lt;BR /&gt;PS_ID=`ps -ef | grep &amp;lt;scripta&amp;gt; | awk '{print $2}'`&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;MYTEST=`ps -p $PS_ID`&lt;BR /&gt;if [ "$MYTEST" = "" ]&lt;BR /&gt;then&lt;BR /&gt;    exit&lt;BR /&gt;fi&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;James</description>
      <pubDate>Thu, 02 Oct 2003 15:15:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084413#M143367</guid>
      <dc:creator>James Randall</dc:creator>
      <dc:date>2003-10-02T15:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084414#M143368</link>
      <description>Ok... I understand now...&lt;BR /&gt;&lt;BR /&gt;When the PID is null, then kick off the other script...&lt;BR /&gt;&lt;BR /&gt;When scripta hangs, the PID is still valid and needs to be killed and the script is restarted...&lt;BR /&gt;&lt;BR /&gt;The problem is when I restart the script (basically with a never ending loop), I can't continue my monitoring phase...&lt;BR /&gt;once it kicks off... Because it is waiting for a never ending loop type process to end before it continues...&lt;BR /&gt;&lt;BR /&gt;I don't know if that clears things up or makes it more confusing...&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Oct 2003 15:28:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3084414#M143368</guid>
      <dc:creator>William Mounsey</dc:creator>
      <dc:date>2003-10-02T15:28:12Z</dc:date>
    </item>
  </channel>
</rss>

