<?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 get exit code of a command executed by nohup in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262745#M888699</link>
    <description>Hi,&lt;BR /&gt;I have a script to create a compressed export file from Oracle with this lines:&lt;BR /&gt;...&lt;BR /&gt;if [ ! -p /tmp/exp_pipe ]; then&lt;BR /&gt;        mknod /tmp/exp_pipe p&lt;BR /&gt;fi&lt;BR /&gt;nohup compress $TMP_EXPORTFILE  &amp;amp;&lt;BR /&gt;&lt;BR /&gt;exp system/manager file=/tmp/exp_pipe full=y feedback=10000 compress=y direct=y consistent=y &amp;gt;&amp;gt;$TMP_LOGFILE 2&amp;gt;&amp;gt;$TMP_LOGFILE&lt;BR /&gt;&lt;BR /&gt;reading mails sent by crontab, I saw that compress fail with segmentation error, but export run till the end without problem reporting successful completition.&lt;BR /&gt;&lt;BR /&gt;how can I check the exit code of 'compress' command running in background by nohup command?&lt;BR /&gt;&lt;BR /&gt;Thankyou</description>
    <pubDate>Thu, 29 Apr 2004 07:49:10 GMT</pubDate>
    <dc:creator>Paolo Gilli</dc:creator>
    <dc:date>2004-04-29T07:49:10Z</dc:date>
    <item>
      <title>get exit code of a command executed by nohup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262745#M888699</link>
      <description>Hi,&lt;BR /&gt;I have a script to create a compressed export file from Oracle with this lines:&lt;BR /&gt;...&lt;BR /&gt;if [ ! -p /tmp/exp_pipe ]; then&lt;BR /&gt;        mknod /tmp/exp_pipe p&lt;BR /&gt;fi&lt;BR /&gt;nohup compress $TMP_EXPORTFILE  &amp;amp;&lt;BR /&gt;&lt;BR /&gt;exp system/manager file=/tmp/exp_pipe full=y feedback=10000 compress=y direct=y consistent=y &amp;gt;&amp;gt;$TMP_LOGFILE 2&amp;gt;&amp;gt;$TMP_LOGFILE&lt;BR /&gt;&lt;BR /&gt;reading mails sent by crontab, I saw that compress fail with segmentation error, but export run till the end without problem reporting successful completition.&lt;BR /&gt;&lt;BR /&gt;how can I check the exit code of 'compress' command running in background by nohup command?&lt;BR /&gt;&lt;BR /&gt;Thankyou</description>
      <pubDate>Thu, 29 Apr 2004 07:49:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262745#M888699</guid>
      <dc:creator>Paolo Gilli</dc:creator>
      <dc:date>2004-04-29T07:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: get exit code of a command executed by nohup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262746#M888700</link>
      <description>If you encapsulate the compress command into a script and nohup the script :&lt;BR /&gt;script :&lt;BR /&gt;compress $TMP_EXPORTFILE &lt;BR /&gt;rc=$?&lt;BR /&gt;echo "return code for compress " $rc &amp;gt;&amp;gt;&lt;YOURLOGFILE&gt;&lt;BR /&gt;&lt;BR /&gt;nohup script &amp;gt; script.out 2&amp;gt;&amp;amp;1 &amp;amp;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Jean-Luc&lt;BR /&gt;&lt;/YOURLOGFILE&gt;</description>
      <pubDate>Thu, 29 Apr 2004 08:02:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262746#M888700</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2004-04-29T08:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: get exit code of a command executed by nohup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262747#M888701</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Try $? straight after the compress&lt;BR /&gt;&lt;BR /&gt;            Steve Steel</description>
      <pubDate>Thu, 29 Apr 2004 08:03:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262747#M888701</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2004-04-29T08:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: get exit code of a command executed by nohup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262748#M888702</link>
      <description>With nohup, you are protecting the process (compress) from being aborted when the parent exits. With &amp;amp;, you separate the process from the parent so naturally there will be no meaningful return code. The reason is that nohup ... &amp;amp; returns immediately to the parent and of course, it will report all is well because the process was started OK. If you need to monitor the success of a background process, you'll need to script it to store a code that can be tested.</description>
      <pubDate>Thu, 29 Apr 2004 09:22:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262748#M888702</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-04-29T09:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: get exit code of a command executed by nohup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262749#M888703</link>
      <description>Hi Paolo,&lt;BR /&gt;a quick solution may be:&lt;BR /&gt;nohup compress $TMP_EXPORTFILE 2&amp;gt;errfile &amp;amp;&lt;BR /&gt;tail -f errfile&lt;BR /&gt;&lt;BR /&gt;In this way you will see in real time the error coming from the compress&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;Art</description>
      <pubDate>Fri, 30 Apr 2004 03:00:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262749#M888703</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2004-04-30T03:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: get exit code of a command executed by nohup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262750#M888704</link>
      <description>Just a note about tail -f: it is really designed for a terminal where you watch the monitored data stream, and it runs forever until it is sent a kill signal. In a script, it is quite complicated to handle this condition. Just take stdout and stderr and route them to a file, then check the contents once the compress job is complete. One way to check is to use fuser compressed_file_name.Z and while compression is running, fuser will report the process ID for the compress process, then nothing when it is done.</description>
      <pubDate>Fri, 30 Apr 2004 07:51:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262750#M888704</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-04-30T07:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: get exit code of a command executed by nohup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262751#M888705</link>
      <description>Don't have time to verify, but doesnt compress hangs on 2Gb files ? How large is your export file ?&lt;BR /&gt;&lt;BR /&gt;If this is the case, you should either pipe to split before compress, or choose an other compress utility such as gzip (which compresses better).&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Apr 2004 08:33:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262751#M888705</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-04-30T08:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: get exit code of a command executed by nohup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262752#M888706</link>
      <description>Hello,&lt;BR /&gt;thank to all for the answers to my question.&lt;BR /&gt;Fred: you are right, compress hangs on 2Gb files(tested on HP-UX 11.0). The oracle istance I have to export, running on Linux RH AS 2.1 and the compress problem occours when the export.Z files size is about 340/360Mb. As you suggested, using gzip instead compress I have no problem but I need to check the result of compress operation.&lt;BR /&gt;So as Bill and Jean-Luc wrote, I will script the background process to store a code that can be tested.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Paolo</description>
      <pubDate>Mon, 03 May 2004 02:58:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262752#M888706</guid>
      <dc:creator>Paolo Gilli</dc:creator>
      <dc:date>2004-05-03T02:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: get exit code of a command executed by nohup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262753#M888707</link>
      <description>I worked with gzip for a while and had no problem to compress/decompress (no corruption of export file).&lt;BR /&gt;&lt;BR /&gt;If you search for better compression, you should have a look at bzip2, which compresses a bit slower but better than gzip (no corruption problem either)&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Mon, 03 May 2004 06:55:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-exit-code-of-a-command-executed-by-nohup/m-p/3262753#M888707</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-05-03T06:55:00Z</dc:date>
    </item>
  </channel>
</rss>

