summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarshula Jayasuriya <harshula@redhat.com>2013-09-18 11:54:26 -0400
committerSteve Dickson <steved@redhat.com>2013-09-18 15:10:26 -0400
commitcbf22367d0b1c1e200a51ec1e33f5438d1edd14f (patch)
tree20b9aab2fe1531f866d7a680bf610dffe0852e8a
parent9b5c3c6a6571a265a90cfce30345891fac24a67c (diff)
downloadnfs-utils-cbf22367d0b1c1e200a51ec1e33f5438d1edd14f.tar.gz
nfs-utils-cbf22367d0b1c1e200a51ec1e33f5438d1edd14f.tar.xz
nfs-utils-cbf22367d0b1c1e200a51ec1e33f5438d1edd14f.zip
nfsiostat: periodically flush stdout
In a shell script, when nfsiostat is run in the background with stdout redirected to a file, flush stdout periodically to ensure that we do not lose the buffered output if the nfsiostat process is killed. Signed-off-by: Harshula Jayasuriya <harshula@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--tools/nfs-iostat/nfs-iostat.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
index c035537..155581c 100644
--- a/tools/nfs-iostat/nfs-iostat.py
+++ b/tools/nfs-iostat/nfs-iostat.py
@@ -413,6 +413,8 @@ class DeviceData:
self.__print_rpc_op_stats('WRITE', sample_time)
self.__print_page_stats(sample_time)
+ sys.stdout.flush()
+
#
# Functions
#