From 35b7a18e6b0e940ac669752b6fd4c638c09392ca Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Tue, 30 Sep 2014 20:35:40 +0200 Subject: [PATCH] Add output for total time --- backup-zfs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backup-zfs b/backup-zfs index 7ac2f39..c060712 100755 --- a/backup-zfs +++ b/backup-zfs @@ -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): -- 2.39.5