Operating System - Linux
1748194 Members
3857 Online
108759 Solutions
New Discussion юеВ

Re: awk to rotate sar hourly

 
SOLVED
Go to solution
lawrenzo_1
Super Advisor

awk to rotate sar hourly

Hello,

I am currently developing a script to run sar and write the output to a file however I always look for the most effiecent way and also am still in "The learning phase" for awk.

can someone give me some idea's how I can get awk to run the sar command every 60 seconds, then rotate the output file after one hour.

I can do this using loops and count but as mentioned I don't believe this is the most effecient with regards to system resource.

Thanks experts ....

Chris.
hello
3 REPLIES 3
Peter Godron
Honored Contributor
Solution

Re: awk to rotate sar hourly

Chris,
man sar gives you two formats:

sar 60 60
which would run sar at 60 sec intervals 60 times (form 1)

Or you could extract from /var/adm/sa/sadd
giving the start(-s) - end(-e) at interval -i
into your hourly file.
lawrenzo_1
Super Advisor

Re: awk to rotate sar hourly

Thanks Peter,


Actually I knew this but was thinking outside the box when actually there was no need to.

hello
lawrenzo_1
Super Advisor

Re: awk to rotate sar hourly

cheers
hello