2010-04-15 14:16:06

by roywoco

[permalink] [raw]
Subject: Repeat a command in background


I would like to capture the output of vmstat every 10 min into a file. Can
anyone know how I can do it?

Thanks
Roy
--
View this message in context: http://old.nabble.com/Repeat-a-command-in-background-tp28255878p28255878.html
Sent from the linux-kernel mailing list archive at Nabble.com.


2010-04-15 14:48:07

by Daniel Mack

[permalink] [raw]
Subject: Re: Repeat a command in background

On Thu, Apr 15, 2010 at 07:16:03AM -0700, roywoco wrote:
> I would like to capture the output of vmstat every 10 min into a file. Can
> anyone know how I can do it?

Very wrong list for such questions, dude. Nevermind ...

#!/bin/sh

file=/tmp/file
while [ true ]; do
cat /proc/vmstat >> $file
sleep 600
done