Link to home
Start Free TrialLog in
Avatar of PrabAsh
PrabAsh

asked on

Running SAR command in the background forever

Hi Experts,

Below is the command issued on SUSE LINUX 11 server to run in the background in order to collect the performance data.

sar 60 > sar.output 2>&1 &

When I looked at the output(sar.output) after 10 hours, it logged only 180 entries which is equivalent to 3 hours of run. I could not see any sar process running in the background. The above command should run continuously without any interruption. Why did the process got aborted after certain period of time. Please help.

Thanks,
PrabAsh
Avatar of Zephyr ICT
Zephyr ICT
Flag of Belgium image

I think if you use the interval switch it runs as a background process continously ... Not sure, been a while.
Something like:

sar -o datafile interval count >/dev/null 2>&1 &

Open in new window


Like this all data is captured in binary and saved to a file (datafile), this data can be selectively displayed with the the -f option.  If the count parameter is not used, all the data saved in the file will be selected, using it this way you can characterize system usage over a period of time, it should run continuously like this... I haven't tested it beyond an hour at the most though...
ASKER CERTIFIED SOLUTION
Avatar of robocat
robocat

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial