Whamcloud - gitweb
LU-4713 tests: fix fhandle syscall test progarm
[fs/lustre-release.git] / lustre / tests / runvmstat
1 #!/bin/sh
2 DELAY=1
3 null() {
4         :
5 }
6
7 case "$1" in
8 -q)     echo "echo off"
9         ECHO="null"
10         shift ;;
11 [1-9]*)
12         DELAY=$1
13         ECHO=echo
14         shift ;;
15 *)
16         echo "echo on"
17         ECHO=echo
18 esac
19
20 vmstat $DELAY | while read LINE ; do
21         LINE="`date +%s`: $LINE"
22         $ECHO "$LINE"
23         [ "$1" ] && echo "$LINE" >> $1
24 done