<?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: nohup in crontab in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021681#M300059</link>
    <description>Hi guys,&lt;BR /&gt;Thanx for ur response,&lt;BR /&gt;i just found a similar topic and i m following raj's advice of running the script without nohup..&lt;BR /&gt;But now i would like to know how to &lt;BR /&gt;use trap in my  script to ignore the hangup and exit signals.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1038827" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1038827&lt;/A&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 18 Jun 2007 04:36:17 GMT</pubDate>
    <dc:creator>boomer_2</dc:creator>
    <dc:date>2007-06-18T04:36:17Z</dc:date>
    <item>
      <title>nohup in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021677#M300055</link>
      <description>Hi guys,&lt;BR /&gt;I am trying to run the below  script in crontab after every 10 min...&lt;BR /&gt;&lt;BR /&gt;#cat /tmp/xyzchk.sh&lt;BR /&gt;&lt;BR /&gt;CC=`ls /abc/sd/r/spool/Interfaces/BATCH-UPLOADS-5|wc -l`&lt;BR /&gt;if [ "$CC" -ne "0" ]&lt;BR /&gt;then&lt;BR /&gt;echo "File has arrived"&lt;BR /&gt;/usr/bin/nohup /xyz/r/cat/script &amp;gt; $out/tfdrtrig.log &amp;amp;&lt;BR /&gt;else&lt;BR /&gt;echo "File doesnt exist"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;What i am doing is checking whether specific file has come and if yes then run a script in background by using nohup..&lt;BR /&gt;But when i am checking after file  arrives,the cronjob does not run, it does not show in &lt;BR /&gt;ps -ef|grep script&lt;BR /&gt;Cronjob entry for that user test is as follows:&lt;BR /&gt;10,20,30,40,50,59 * * * * /tmp/xyzchk.sh  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1..the user test is already mentioned in /var/adm/cron.allow file..</description>
      <pubDate>Mon, 18 Jun 2007 02:51:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021677#M300055</guid>
      <dc:creator>boomer_2</dc:creator>
      <dc:date>2007-06-18T02:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: nohup in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021678#M300056</link>
      <description>&lt;BR /&gt;what does /var/adm/cron/log say (if anything?)&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Duncan</description>
      <pubDate>Mon, 18 Jun 2007 03:07:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021678#M300056</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2007-06-18T03:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: nohup in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021679#M300057</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you need to define  $out&lt;BR /&gt;Check also the mail for the user in question and include the shell interpreter at the beginning. e.g.&lt;BR /&gt; #!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Jun 2007 03:18:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021679#M300057</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2007-06-18T03:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: nohup in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021680#M300058</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;at first do not redirect stdout/stderr to /dev/null but a file or let mail do this work.&lt;BR /&gt;So you can inspect your own and system generated messages.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Mon, 18 Jun 2007 03:43:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021680#M300058</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-06-18T03:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: nohup in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021681#M300059</link>
      <description>Hi guys,&lt;BR /&gt;Thanx for ur response,&lt;BR /&gt;i just found a similar topic and i m following raj's advice of running the script without nohup..&lt;BR /&gt;But now i would like to know how to &lt;BR /&gt;use trap in my  script to ignore the hangup and exit signals.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1038827" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1038827&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Jun 2007 04:36:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021681#M300059</guid>
      <dc:creator>boomer_2</dc:creator>
      <dc:date>2007-06-18T04:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: nohup in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021682#M300060</link>
      <description>&amp;gt;But now i would like to know how to use trap in my script to ignore the hangup and exit signals.&lt;BR /&gt;&lt;BR /&gt;A cron job isn't normally going to get a hangup signal.  I'm not sure what you mean by exit?&lt;BR /&gt;&lt;BR /&gt;There is a trap on exit from functions, see ksh(1)/sh(1) trap command.</description>
      <pubDate>Mon, 18 Jun 2007 07:53:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021682#M300060</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-06-18T07:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: nohup in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021683#M300061</link>
      <description>Hi Dennis,&lt;BR /&gt;Now i am not able to run the script from cronjob without nohup...&lt;BR /&gt;After the file ahs arrived, the cron is not getting executed from that particular user which i have mentioned in /var/adm/cron.allow.</description>
      <pubDate>Tue, 19 Jun 2007 01:55:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021683#M300061</guid>
      <dc:creator>boomer_2</dc:creator>
      <dc:date>2007-06-19T01:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: nohup in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021684#M300062</link>
      <description>&lt;!--!*#--&gt;nohup shouldn't help for crontab.  But if it does, it probably isn't worthwhile figuring it out why.  If it works, just continue to use it.&lt;BR /&gt;&lt;BR /&gt;So what works?  What is your current status?&lt;BR /&gt;You were asked for the contents of /var/adm/cron/log.&lt;BR /&gt;&lt;BR /&gt;(I assume you meant /var/adm/cron/cron.allow?)&lt;BR /&gt;&lt;BR /&gt;You do know that this will send junk to stderr if it doesn't exist?&lt;BR /&gt;CC=`ls .../BATCH-UPLOADS-5|wc -l`&lt;BR /&gt;&lt;BR /&gt;You can fix it by:&lt;BR /&gt;ls .../BATCH-UPLOADS-5 &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;if [ $? -eq 0 ]; then&lt;BR /&gt;   echo "File has arrived"</description>
      <pubDate>Tue, 19 Jun 2007 03:10:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021684#M300062</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-06-19T03:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: nohup in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021685#M300063</link>
      <description>Hi Dennis,&lt;BR /&gt;First  of all let me make it clear to you as what i want to do ..&lt;BR /&gt;&lt;BR /&gt;i want to run a script called xyz.sh kept in /abc/def/xyz.sh location ,only when a file arrives at /wer/thy/def location.&lt;BR /&gt;&lt;BR /&gt;So im checking for /wer/thy/def locn,by taking word count if its not equal to zero that means the file has arrived and hence i m running the script called xyz.sh from /abc/def/xyz.sh .&lt;BR /&gt;&lt;BR /&gt;this is a scriptm mentioned in my crontab called tfcheck.sh.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#tfcheck.sh&lt;BR /&gt;CC=`ls /wer/thy/def |wc -l`&lt;BR /&gt;if [ "$CC" -ne "0" ]&lt;BR /&gt;then&lt;BR /&gt;/abc/def/xyz.sh &amp;gt; $sysout/tfdrtrig.log&lt;BR /&gt;else&lt;BR /&gt;echo "File doesnot exist"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;MY CRONTAB entry is as follows:-&amp;gt;&lt;BR /&gt;5,10,15,20,25,30,35,40,45,50,55,59 * * * * /tmp/tfcheck.sh  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Jun 2007 04:13:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021685#M300063</guid>
      <dc:creator>boomer_2</dc:creator>
      <dc:date>2007-06-19T04:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: nohup in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021686#M300064</link>
      <description>Hi Dennis,&lt;BR /&gt;First  of all let me make it clear to you as what i want to do ..&lt;BR /&gt;&lt;BR /&gt;i want to run a script called xyz.sh kept in /abc/def/xyz.sh location ,only when a file arrives at /wer/thy/def location.&lt;BR /&gt;&lt;BR /&gt;So im checking for /wer/thy/def locn,by taking word count if its not equal to zero that means the file has arrived and hence i m running the script called xyz.sh from /abc/def/xyz.sh .&lt;BR /&gt;&lt;BR /&gt;this is a scriptm mentioned in my crontab called tfcheck.sh.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#tfcheck.sh&lt;BR /&gt;CC=`ls /wer/thy/def |wc -l`&lt;BR /&gt;if [ "$CC" -ne "0" ]&lt;BR /&gt;then&lt;BR /&gt;/abc/def/xyz.sh &amp;gt; $out/tf.log&lt;BR /&gt;else&lt;BR /&gt;echo "File doesnot exist"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;MY CRONTAB entry is as follows:-&amp;gt;&lt;BR /&gt;5,10,15,20,25,30,35,40,45,50,55,59 * * * * /tmp/tfcheck.sh  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Jun 2007 04:14:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021686#M300064</guid>
      <dc:creator>boomer_2</dc:creator>
      <dc:date>2007-06-19T04:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: nohup in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021687#M300065</link>
      <description>Hi again,&lt;BR /&gt;&lt;BR /&gt;if your script is located in &lt;BR /&gt;/abc/def/xyz.sh&lt;BR /&gt;you better put that in your crontab entry instead of&lt;BR /&gt;/tmp/tfcheck.sh&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Tue, 19 Jun 2007 04:41:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021687#M300065</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2007-06-19T04:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: nohup in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021688#M300066</link>
      <description>Hi John,&lt;BR /&gt;The thing is that abc/def/xyz.sh in turn calls 2-3 scipts more and i can't mofidy that script...&lt;BR /&gt;So im using this way to run the script /abc/def/xyz.sh through cron .</description>
      <pubDate>Tue, 19 Jun 2007 04:47:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021688#M300066</guid>
      <dc:creator>boomer_2</dc:creator>
      <dc:date>2007-06-19T04:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: nohup in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021689#M300067</link>
      <description>I see you have made no progress or any changes?&lt;BR /&gt;The first thing you should do is remove the output redirection in the crontab:&lt;BR /&gt;10,20,30,40,50,59 * * * * /tmp/xyzchk.sh&lt;BR /&gt;&lt;BR /&gt;The next thing you need to do is look at /var/adm/cron/log after 10 minutes and provide that result.&lt;BR /&gt;&lt;BR /&gt;As mentioned by John, you need to define $out in:  /abc/def/xyz.sh &amp;gt; $out/tf.log &lt;BR /&gt;&lt;BR /&gt;Once you have these, you need to provide the cron log, your mail and tf.log.</description>
      <pubDate>Tue, 19 Jun 2007 05:14:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-in-crontab/m-p/4021689#M300067</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-06-19T05:14:31Z</dc:date>
    </item>
  </channel>
</rss>

