<?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: shell file doesn't run with crontab in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-file-doesn-t-run-with-crontab/m-p/3877220#M279458</link>
    <description>Hi Hoang,&lt;BR /&gt;&lt;BR /&gt;check that your script /script/perfcheck/checkperf.sh has registered both start and end in /var/adm/cron/log; it may not have finished.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
    <pubDate>Tue, 10 Oct 2006 01:17:13 GMT</pubDate>
    <dc:creator>john korterman</dc:creator>
    <dc:date>2006-10-10T01:17:13Z</dc:date>
    <item>
      <title>shell file doesn't run with crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-file-doesn-t-run-with-crontab/m-p/3877218#M279456</link>
      <description>Hi all&lt;BR /&gt;&lt;BR /&gt;Has anyone faced with this trouble:&lt;BR /&gt;&lt;BR /&gt;I have create a scheduled task in crontab:&lt;BR /&gt;00      01      *       *       *       sh /script/perfcheck/checkperf.sh&lt;BR /&gt;&lt;BR /&gt;This shell file will kill and old process and will execute a new process for monitoring system performance.&lt;BR /&gt;And the content of that sell file:&lt;BR /&gt;########################&lt;BR /&gt;ps -ef|grep glance | grep adviser |cut -c9-19 | while read name&lt;BR /&gt;do kill -9 $name&lt;BR /&gt;done&lt;BR /&gt;sh /script/perfcheck/perflog.sh&lt;BR /&gt;#########################&lt;BR /&gt;&lt;BR /&gt;The perflog.sh file content:&lt;BR /&gt;##########################&lt;BR /&gt;GetDate=`date +"%Y%m%d"`&lt;BR /&gt;LOG_NM=/script/perfcheck/logfile/log.$GetDate&lt;BR /&gt;nohup glance -j 60 -adviser_only -syntax /script/perfcheck/advfile &amp;gt;&amp;gt;$LOG_NM &amp;amp;&lt;BR /&gt;##########################&lt;BR /&gt;The advfile file:&lt;BR /&gt;&lt;BR /&gt;##########################&lt;BR /&gt;print GBL_STATTIME, GBL_CPU_TOTAL_UTIL, GBL_DISK_UTIL_PEAK, GBL_MEM_UTIL, GBL_SWAP_SPACE_UTIL, GBL_DISK_SUBSYSTEM_QUEUE&lt;BR /&gt;##########################&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The strange thing is: &lt;BR /&gt;&lt;BR /&gt;It killed successful the old process but it doesn't run new process. That means the command:&lt;BR /&gt;sh /script/perfcheck/perflog.sh doens't run but the logfile still created (it just create the logfile only!)&lt;BR /&gt;&lt;BR /&gt;Thanks in advanced!</description>
      <pubDate>Mon, 09 Oct 2006 22:35:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-file-doesn-t-run-with-crontab/m-p/3877218#M279456</guid>
      <dc:creator>Hoang Chi Cong_1</dc:creator>
      <dc:date>2006-10-09T22:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: shell file doesn't run with crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-file-doesn-t-run-with-crontab/m-p/3877219#M279457</link>
      <description>Can you try giving the full path for glance&lt;BR /&gt;/opt/perf/bin/glance &lt;BR /&gt;OR add PATH variable in the script at the beginning to include the path.&lt;BR /&gt;Isnt any error reflected in the mail that you get for cron jobs ?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ninad</description>
      <pubDate>Tue, 10 Oct 2006 00:21:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-file-doesn-t-run-with-crontab/m-p/3877219#M279457</guid>
      <dc:creator>Ninad_1</dc:creator>
      <dc:date>2006-10-10T00:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: shell file doesn't run with crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-file-doesn-t-run-with-crontab/m-p/3877220#M279458</link>
      <description>Hi Hoang,&lt;BR /&gt;&lt;BR /&gt;check that your script /script/perfcheck/checkperf.sh has registered both start and end in /var/adm/cron/log; it may not have finished.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Tue, 10 Oct 2006 01:17:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-file-doesn-t-run-with-crontab/m-p/3877220#M279458</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2006-10-10T01:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: shell file doesn't run with crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-file-doesn-t-run-with-crontab/m-p/3877221#M279459</link>
      <description>Hi, If you cannot find enough information in /var/adm/crom/log you can set debug mode in your cronjob:&lt;BR /&gt;00 01 * * * sh -x /script/perfcheck/checkperf.sh &amp;gt; /tmp/hcc1.debug&lt;BR /&gt;&lt;BR /&gt;########################&lt;BR /&gt;ps -ef|grep glance | grep adviser |cut -c9-19 | while read name&lt;BR /&gt;do kill -9 $name&lt;BR /&gt;done&lt;BR /&gt;sh -x /script/perfcheck/perflog.sh &amp;gt; /tmp/hcc2.debug&lt;BR /&gt;#########################&lt;BR /&gt;&lt;BR /&gt;It will record cronjob execution step by step into hcc1.debug and hcc2.debug. After you fix your problem, you can remove "-x" option.&lt;BR /&gt;&lt;BR /&gt;Yang</description>
      <pubDate>Tue, 10 Oct 2006 01:33:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-file-doesn-t-run-with-crontab/m-p/3877221#M279459</guid>
      <dc:creator>Yang Qin_1</dc:creator>
      <dc:date>2006-10-10T01:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: shell file doesn't run with crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-file-doesn-t-run-with-crontab/m-p/3877222#M279460</link>
      <description>That the logfile is created is normal, because this is part of the nohup command.&lt;BR /&gt;The default log is nohup.out unless you &lt;BR /&gt;specify an alternative log, which in your&lt;BR /&gt;case is done.&lt;BR /&gt;&lt;BR /&gt;However, I would prefer to spawn the perflog.sh as an executable script, and&lt;BR /&gt;put the shell inside the script:&lt;BR /&gt;&lt;BR /&gt;Thus&lt;BR /&gt;/script/perfcheck/perflog.sh &lt;BR /&gt;(chmod u+x perflog.sh)&lt;BR /&gt;&lt;BR /&gt;shell identifier (must be on the first line and fields !!)&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;#set -x  &lt;BR /&gt;GetDate=`date +"%Y%m%d"`&lt;BR /&gt;LOG_NM=/script/perfcheck/logfile/log.$GetDate&lt;BR /&gt;nohup /path/glance -j 60 -adviser_only -syntax /script/perfcheck/advfile &amp;gt;&amp;gt;$LOG_NM &amp;amp;&lt;BR /&gt;print "background PID = $! " &lt;BR /&gt;&lt;BR /&gt;NB:Also use a qualified path name for glance&lt;BR /&gt;(but this was already mentioned)&lt;BR /&gt;&lt;BR /&gt;And check if the background process has in&lt;BR /&gt;fact started but is not doing what you expected. In that case all works well and&lt;BR /&gt;the log will stay empty. It is normal behaviour. You then need to concentrate on the glance command. Try and run it manually first like this:&lt;BR /&gt;&lt;BR /&gt;#nohup /path/glance -j 60 -adviser_only -syntax /script/perfcheck/advfile &amp;gt;&amp;gt;$LOG_NM &amp;amp;&lt;BR /&gt;print "background PID = $! " &lt;BR /&gt;&lt;BR /&gt;If that works then we need to look further.&lt;BR /&gt;Otherwise trace by putting &lt;BR /&gt;set -x or set -xv in the perflog.sh on the second line to see what is going on.&lt;BR /&gt;&lt;BR /&gt;Good luck.&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Oct 2006 02:12:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-file-doesn-t-run-with-crontab/m-p/3877222#M279460</guid>
      <dc:creator>Frank de Vries</dc:creator>
      <dc:date>2006-10-10T02:12:20Z</dc:date>
    </item>
  </channel>
</rss>

