From 537b4b255e502011b7338c676fe2e64de4c74446 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Mon, 14 May 2012 08:53:02 +0200 Subject: [PATCH] enable output of tar --- TODO.txt | 5 ++++- shbackup | 20 ++------------------ 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/TODO.txt b/TODO.txt index f5f0b2c..2488c32 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1 +1,4 @@ -- support sporadic full backups +- print size in list +- remember tar commands +- ask to proceed when making backup +- print and log exit code and stderr of tar afterwards diff --git a/shbackup b/shbackup index cc323c5..db2c661 100755 --- a/shbackup +++ b/shbackup @@ -248,28 +248,12 @@ class BackupManager: taropts += ["--exclude", pat] tarargs = [tarpath] + taropts + ["-f", fsfn] + fileset.dirs - print("tarargs: ", tarargs) - tarp = subprocess.Popen( tarargs, \ - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - - while tarp.poll(): - l = tarp.stdout.readline() - if len(l) > 0: - print(l.decode(), end="") - l = tarp.stderr.readline() - if len(l) > 0: - print(l.decode(), end="") - - for l in tarp.stdout.readlines(): - print(l.decode(), end="") - - for l in tarp.stderr.readlines(): - print(l.decode(), end="") + #print("tarargs: ", tarargs) + tarp = subprocess.Popen( tarargs ) rett = tarp.wait() if rett != 0: print(tarpath + " returned with exit status " + str(rett) + ":") - print( tarp.stderr.read().decode() ) def backup(self, epoch=None, mode=None): -- 2.30.2