From: Christoph Egger Date: Mon, 5 Jan 2015 17:55:30 +0000 (+0100) Subject: Only print data rate after second junk (it's not reliable before) X-Git-Url: https://git.siccegge.de//index.cgi?a=commitdiff_plain;h=c4e66206d0cd9ab1c152d99fe1d5c91cb9c88868;p=tools.git Only print data rate after second junk (it's not reliable before) --- 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)