0

Im trying to automate a long list of database experiments. I would like to save vmstat output while specific parts of the experiments are running.

Does something exist along the lines of time(1) or script(1) that I could use to say: " While this command is running, save vmstat 2(or similar) output to a file " in my bash scripts

I am aware that vmstat gives my vmstat for the complete system including other processes, but that is OK for my usage.

(Running Ubuntu 9.10 if that makes a difference)

svrist
  • 183
  • 7

1 Answers1

1
vmstat 2 > ~/vmlog.txt &
vmpid=$!
my_funky_command
kill $vmpid
Phil P
  • 3,080
  • 1
  • 16
  • 19
  • I was hoping I didnt have to do it like that :) I have bad milage with the & operator and $! in my bash scripts (and dd) – svrist Apr 06 '10 at 09:08