- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: unable to use sar -A -o in a script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2007 06:49 PM
тАО09-21-2007 06:49 PM
unable to use sar -A -o in a script
But whenever i am starting my script as a background process,it's showing 'DONE' in the next second but giving the output.
Can anyone help me in this regard? how to get all sar data using 'sar -A -o outfile interval count' using a shell script?
But when i am running sar -A -o outfile interval count > /dev/null &
in the commandline it's working fine.
I have attached the script ....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2007 09:13 PM
тАО09-21-2007 09:13 PM
Re: unable to use sar -A -o in a script
When you say background process, do you mean the script is being kicked off from the cron ?
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...
Cheers,
Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2007 09:23 PM
тАО09-21-2007 09:23 PM
Re: unable to use sar -A -o in a script
No i am running the script as ./script.ksh &
but the sar process is not happening properly.
but mpsat,prstat all are going on fine in that script(prstat 5 6 >> output.txt)
Also sar -u 5 6 >>sar_output is fine.
but only sar -A -o output 5 6 > /dev/null & is not working in that script.
Is there any other way to write a script for getting the same output of sar -A -o output 5 6 > /dev/null &
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2007 01:30 AM
тАО09-22-2007 01:30 AM
Re: unable to use sar -A -o in a script
The 'sar' is getting put into the background, yes. But then the script is ending.
Using KSH on OSR5 boxes, this usually meant that the backgrounded processes would get HUP'd by the ending shell.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-23-2007 04:10 PM
тАО09-23-2007 04:10 PM
Re: unable to use sar -A -o in a script
I have used sar -A -o output 5 5 > junkfile &
for this script is creating two output file now.one is binary sar output 'output' file & another file is 'junkfile' .So is it proper to use like that or any other way to optimize the script?
Is there any other way to do it?