]> git.siccegge.de Git - tools.git/commitdiff
Add output for total time
authorChristoph Egger <christoph@christoph-egger.org>
Tue, 30 Sep 2014 18:35:40 +0000 (20:35 +0200)
committerChristoph Egger <christoph@christoph-egger.org>
Tue, 30 Sep 2014 18:35:40 +0000 (20:35 +0200)
backup-zfs

index 7ac2f39ee2851b06103b771c450f18f5f180a3fa..c060712c3f1bcbe284ecad49128efcf20dfc7169 100755 (executable)
@@ -128,7 +128,8 @@ def sftp_send(dataset, reference=None):
                 junk = gpg.stdout.read(BUFFER)
 
             sys.stdout.write('\r')
-            print_colored(" %.3f GB DONE (%.3f MB/s)" % ((1.0 * done) / (1024 ** 3), (done / (1024 ** 2 *(time.time() - startt)))), 'green')
+            timedelta = time.time() - startt
+            print_colored(" %.3f GB DONE (%.3f MB/s) Total: %02d%02d:%02d" % ((1.0 * done) / (1024 ** 3), (done / (1024 ** 2 *timedelta)), timedelta/3600, (timedelta/60)%60, timedelta%60), 'green')
             digestfile.write("%s  %s\n" % (digest.hexdigest(), filename))
 
 def syncronize(local_datasets, remote_datasets):