From c4e66206d0cd9ab1c152d99fe1d5c91cb9c88868 Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Mon, 5 Jan 2015 18:55:30 +0100 Subject: [PATCH] Only print data rate after second junk (it's not reliable before) --- backup-zfs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backup-zfs b/backup-zfs index c060712..9d52e06 100755 --- a/backup-zfs +++ b/backup-zfs @@ -121,8 +121,9 @@ def sftp_send(dataset, reference=None): done = done + len(junk) # sys.stdout.write('#') # sys.stdout.flush() - sys.stdout.write("\r%s %.3f GB (%.3f MB/s) " % (term['green'], (1.0 * done) / (1024 ** 3), (done / (1024 ** 2 *(time.time() - startt))))) - sys.stdout.flush() + if done != len(junk): + sys.stdout.write(" \r%s %.3f GB (%.3f MB/s)" % (term['green'], (1.0 * done) / (1024 ** 3), (done / (1024 ** 2 *(time.time() - startt))))) + sys.stdout.flush() remotefile.write(junk) digest.update(junk) junk = gpg.stdout.read(BUFFER) -- 2.39.5