X-Git-Url: https://git.siccegge.de//index.cgi?a=blobdiff_plain;f=backup-zfs;h=49c16566c2502cfc45dadc62a523a5c83492f3ee;hb=4abb5d1a4e910e698b98f03b00f313b2743e8d53;hp=c060712c3f1bcbe284ecad49128efcf20dfc7169;hpb=35b7a18e6b0e940ac669752b6fd4c638c09392ca;p=tools.git diff --git a/backup-zfs b/backup-zfs index c060712..49c1656 100755 --- a/backup-zfs +++ b/backup-zfs @@ -93,7 +93,7 @@ def sftp_send(dataset, reference=None): zfs = subprocess.Popen(zfscommand, stdout=subprocess.PIPE, bufsize=2*BUFFER) print(zfscommand) - gpgcommand = [ 'gpg', '--batch', '--compress-algo', 'ZLIB', + gpgcommand = [ 'gpg2', '--batch', '--compress-algo', 'ZLIB', '--sign', '--encrypt', '--recipient', GPGUSER ] gpg = subprocess.Popen(gpgcommand, bufsize=2*BUFFER, stdout=subprocess.PIPE, @@ -121,15 +121,16 @@ 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) sys.stdout.write('\r') 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') + 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):