Skip to contentSkip to conversation

Repeat a command in background

DISCUSSION roywoco 2 participants 2 messages Apr 15, 2010

lore
Share & tools
lore

roywoco

author
#0 lore raw

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

Signature · 2 lines
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.
#1 lore raw
Quoted 2 lines · roywoco

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