From: Christoph Egger Date: Tue, 30 Sep 2014 18:35:40 +0000 (+0200) Subject: Add output for total time X-Git-Url: https://git.siccegge.de//index.cgi?p=tools.git;a=commitdiff_plain;h=35b7a18e6b0e940ac669752b6fd4c638c09392ca;hp=6067d72fbe1f4f64aa9aa7a3cf9c130a69da6b0a Add output for total time --- 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):