<?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 unable to use sar -A -o in a script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/unable-to-use-sar-a-o-in-a-script/m-p/4074448#M30148</link>
    <description>I am using sar command in my script for system montoring.So I am running my script as background process.&lt;BR /&gt;But whenever i am starting my script as a background process,it's showing 'DONE' in the next second but giving the output.&lt;BR /&gt;Can anyone help me in this regard? how to get all sar data using 'sar -A -o outfile interval count' using a shell script?&lt;BR /&gt;&lt;BR /&gt;But when i am running sar -A -o outfile interval count &amp;gt; /dev/null &amp;amp; &lt;BR /&gt;in the commandline it's working fine.&lt;BR /&gt;&lt;BR /&gt;I have attached the script ....</description>
    <pubDate>Sat, 22 Sep 2007 01:49:00 GMT</pubDate>
    <dc:creator>Dodo_5</dc:creator>
    <dc:date>2007-09-22T01:49:00Z</dc:date>
    <item>
      <title>unable to use sar -A -o in a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/unable-to-use-sar-a-o-in-a-script/m-p/4074448#M30148</link>
      <description>I am using sar command in my script for system montoring.So I am running my script as background process.&lt;BR /&gt;But whenever i am starting my script as a background process,it's showing 'DONE' in the next second but giving the output.&lt;BR /&gt;Can anyone help me in this regard? how to get all sar data using 'sar -A -o outfile interval count' using a shell script?&lt;BR /&gt;&lt;BR /&gt;But when i am running sar -A -o outfile interval count &amp;gt; /dev/null &amp;amp; &lt;BR /&gt;in the commandline it's working fine.&lt;BR /&gt;&lt;BR /&gt;I have attached the script ....</description>
      <pubDate>Sat, 22 Sep 2007 01:49:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/unable-to-use-sar-a-o-in-a-script/m-p/4074448#M30148</guid>
      <dc:creator>Dodo_5</dc:creator>
      <dc:date>2007-09-22T01:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: unable to use sar -A -o in a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/unable-to-use-sar-a-o-in-a-script/m-p/4074449#M30149</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;When you say background process, do you mean the script is being kicked off from the cron ?&lt;BR /&gt;&lt;BR /&gt;If so, then you may well have to specify the full path to the commands you're using, as cron's environment may not be the same as yours...&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;Rob</description>
      <pubDate>Sat, 22 Sep 2007 04:13:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/unable-to-use-sar-a-o-in-a-script/m-p/4074449#M30149</guid>
      <dc:creator>Rob Leadbeater</dc:creator>
      <dc:date>2007-09-22T04:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: unable to use sar -A -o in a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/unable-to-use-sar-a-o-in-a-script/m-p/4074450#M30150</link>
      <description>Thanks for ur help.....&lt;BR /&gt;No i am running the script as ./script.ksh &amp;amp;&lt;BR /&gt;but the sar process is not happening properly.&lt;BR /&gt;but mpsat,prstat all are going on fine in that script(prstat 5 6 &amp;gt;&amp;gt; output.txt)&lt;BR /&gt;Also sar -u 5 6 &amp;gt;&amp;gt;sar_output is fine.&lt;BR /&gt;but only sar -A -o output 5 6 &amp;gt; /dev/null &amp;amp; is not working in that script.&lt;BR /&gt;&lt;BR /&gt;Is there any other way to write a script for getting the same output of sar -A -o output 5 6 &amp;gt; /dev/null &amp;amp;</description>
      <pubDate>Sat, 22 Sep 2007 04:23:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/unable-to-use-sar-a-o-in-a-script/m-p/4074450#M30150</guid>
      <dc:creator>Dodo_5</dc:creator>
      <dc:date>2007-09-22T04:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: unable to use sar -A -o in a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/unable-to-use-sar-a-o-in-a-script/m-p/4074451#M30151</link>
      <description>My quick guess would be because it's the last line of the script.&lt;BR /&gt;&lt;BR /&gt;The 'sar' is getting put into the background, yes.  But then the script is ending.&lt;BR /&gt;&lt;BR /&gt;Using KSH on OSR5 boxes, this usually meant that the backgrounded processes would get HUP'd by the ending shell.&lt;BR /&gt;&lt;BR /&gt;If you really do wan to keep the 'sar' running after the KSH ends, nohup it, as well as put it into the background, or just 'exec' it, without backgrounding it.</description>
      <pubDate>Sat, 22 Sep 2007 08:30:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/unable-to-use-sar-a-o-in-a-script/m-p/4074451#M30151</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2007-09-22T08:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: unable to use sar -A -o in a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/unable-to-use-sar-a-o-in-a-script/m-p/4074452#M30152</link>
      <description>can you give add the lines required for modification of the script.I have changed a bit to the code myself.&lt;BR /&gt;I have used sar -A -o output 5 5 &amp;gt; junkfile &amp;amp;&lt;BR /&gt;for this script is creating two output file now.one is binary sar output 'output' file &amp;amp; another file is 'junkfile' .So is it proper to use like that or any other way to optimize the script?&lt;BR /&gt;Is there any other way to do it?</description>
      <pubDate>Sun, 23 Sep 2007 23:10:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/unable-to-use-sar-a-o-in-a-script/m-p/4074452#M30152</guid>
      <dc:creator>Dodo_5</dc:creator>
      <dc:date>2007-09-23T23:10:59Z</dc:date>
    </item>
  </channel>
</rss>

