From cbf22367d0b1c1e200a51ec1e33f5438d1edd14f Mon Sep 17 00:00:00 2001 From: Harshula Jayasuriya Date: Wed, 18 Sep 2013 11:54:26 -0400 Subject: 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 Signed-off-by: Steve Dickson --- tools/nfs-iostat/nfs-iostat.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools/nfs-iostat/nfs-iostat.py') 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 # -- cgit