<?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: top not running from cron entry.............. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067392#M438082</link>
    <description>You probably need to use the "-f file" option of top(1), you can't use a pipe, and $61 won't be right.</description>
    <pubDate>Thu, 06 Sep 2007 04:47:02 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2007-09-06T04:47:02Z</dc:date>
    <item>
      <title>top not running from cron entry..............</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067390#M438080</link>
      <description>hi guys,&lt;BR /&gt;I m not able to run this script from cron,but when i run it from prompt , runs fine...........&lt;BR /&gt;&lt;BR /&gt;# dattop.sh&lt;BR /&gt;DT=`/usr/bin/date|awk '{print $1}'`&lt;BR /&gt;TIME=`/usr/bin/date|awk '{print $2,$3,$4}'`&lt;BR /&gt; case $DT in&lt;BR /&gt;              Mon )echo $TIME" ------&amp;gt;" `/usr/bin/top -n3 -d1|awk '{printf $61}'` &amp;gt;&amp;gt; /tmp/Monday.txt                    ;;&lt;BR /&gt;             Tue )echo $TIME" ------&amp;gt;"`/usr/bin/top -n3 -d1|awk '{printf $61}'` &amp;gt;&amp;gt; /tmp/Tuesday.txt&lt;BR /&gt;                        ;;&lt;BR /&gt;           Wed )echo $TIME" ------&amp;gt;" `/usr/bin/top -n3 -d1|awk '{printf $61}'` &amp;gt;&amp;gt; /tmp/Wednesday.txt&lt;BR /&gt;                        ;;&lt;BR /&gt;             Thu )echo $TIME" ------&amp;gt;"`/usr/bin/top -n3 -d1|awk '{printf $61}'` &amp;gt;&amp;gt; /tmp/Thursday.txt&lt;BR /&gt;                        ;;&lt;BR /&gt;             Fri )echo $TIME" ------&amp;gt;"`/usr/bin/top -n3 -d1|awk '{printf $61}'` &amp;gt;&amp;gt; /tmp/Friday.txt&lt;BR /&gt;                        ;;&lt;BR /&gt;             Sat )echo $TIME" ------&amp;gt;"`/usr/bin/top -n3 -d1|awk '{printf $61}'` &amp;gt;&amp;gt; /tmp/Saturday.txt&lt;BR /&gt;                        ;;&lt;BR /&gt;             Sun )echo $TIME" ------&amp;gt;" `/usr/bin/top -n3 -d1|awk '{printf $61}'` &amp;gt;&amp;gt; /tmp/Sunday.txt&lt;BR /&gt;                        ;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cron entry is as follows:-&amp;gt;&lt;BR /&gt;&lt;BR /&gt;5,10,15,20,25,30,35,40,45,50,55  *  *  *  * /tmp/dattop.sh&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Sep 2007 04:29:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067390#M438080</guid>
      <dc:creator>boomer_2</dc:creator>
      <dc:date>2007-09-06T04:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: top not running from cron entry..............</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067391#M438081</link>
      <description>top -n &lt;NUM&gt; -f outfile&lt;/NUM&gt;</description>
      <pubDate>Thu, 06 Sep 2007 04:44:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067391#M438081</guid>
      <dc:creator>AwadheshPandey</dc:creator>
      <dc:date>2007-09-06T04:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: top not running from cron entry..............</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067392#M438082</link>
      <description>You probably need to use the "-f file" option of top(1), you can't use a pipe, and $61 won't be right.</description>
      <pubDate>Thu, 06 Sep 2007 04:47:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067392#M438082</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-09-06T04:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: top not running from cron entry..............</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067393#M438083</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;Since cron has limited or no information on TERM/terminal information, your command will fail without the -f parameter directing the output to go to a file.&lt;BR /&gt;&lt;BR /&gt;It is possible to set up environment in the script /tmp/dattop.sh&lt;BR /&gt;&lt;BR /&gt;Also note that many sysadmins set up cron jobs that delete files that are older than a certain number of days in the /tmp filesystem to prevent congestion(full fs). This is probably not a great place to leave a production script.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 06 Sep 2007 04:59:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067393#M438083</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-09-06T04:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: top not running from cron entry..............</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067394#M438084</link>
      <description>hi steven,&lt;BR /&gt;then how do i set my environment for this kind of script...&lt;BR /&gt;Plzz let me know...&lt;BR /&gt;Also denis why i cant use pipe and awk as the script runs fine in runtime.???&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Sep 2007 06:25:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067394#M438084</guid>
      <dc:creator>boomer_2</dc:creator>
      <dc:date>2007-09-06T06:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: top not running from cron entry..............</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067395#M438085</link>
      <description>&amp;gt;why i cant use pipe and awk as the script runs fine in runtime???&lt;BR /&gt;&lt;BR /&gt;You might be able to export TERM in your script and get it to work the same.&lt;BR /&gt;But you should not be trying to parse the top screen output.  It is better to use the "-f file" output.&lt;BR /&gt;&lt;BR /&gt;top -f doesn't support output to a unnamed pipe, and the "-" convention doesn't work.&lt;BR /&gt;&lt;BR /&gt;So you would send the output to a file, use awk on it (this part will change since you have multiple lines), then remove the file.</description>
      <pubDate>Thu, 06 Sep 2007 15:36:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067395#M438085</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-09-06T15:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: top not running from cron entry..............</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067396#M438086</link>
      <description>Honestly I don't think you need to set the environment, just use the -f parameter.&lt;BR /&gt;&lt;BR /&gt;But if you want:&lt;BR /&gt;&lt;BR /&gt;From the command line:&lt;BR /&gt;&lt;BR /&gt;env &amp;gt; /tmp/env.norm.txt&lt;BR /&gt;&lt;BR /&gt;Take what you need from there and past it into the script that cron is running.&lt;BR /&gt;&lt;BR /&gt;PATH and TERM are critical. stty -a those settings may matter as well.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 06 Sep 2007 16:01:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067396#M438086</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-09-06T16:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: top not running from cron entry..............</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067397#M438087</link>
      <description>Thank u STEVEN,DENIS i followed ur advice and getting d required o/p from cron now successfully.........thanks again..&lt;BR /&gt;POINTS GIVEN</description>
      <pubDate>Fri, 07 Sep 2007 01:49:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/top-not-running-from-cron-entry/m-p/5067397#M438087</guid>
      <dc:creator>boomer_2</dc:creator>
      <dc:date>2007-09-07T01:49:02Z</dc:date>
    </item>
  </channel>
</rss>

