summaryrefslogtreecommitdiff
path: root/sysfiles.sh
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-06-21 21:44:46 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-06-21 21:44:46 -0400
commit896161c483ceef3ed16e2f19a5c05106bed04512 (patch)
tree8e79f92d7b3dfe09fa97f4ae5feb8331ad6fbb52 /sysfiles.sh
I can't believe I didn't have this in git before.
Diffstat (limited to 'sysfiles.sh')
-rw-r--r--sysfiles.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/sysfiles.sh b/sysfiles.sh
new file mode 100644
index 0000000..54229d8
--- /dev/null
+++ b/sysfiles.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+cputime_file=${TMPDIR-/tmp}/cputime
+
+mpstat -P ALL 1 > "$cputime_file" &
+
+while true; do
+ cputime="`tail -n4 "$cputime_file"`"
+ echo "$cputime">"$cputime_file"
+ sleep 1
+done