From 7e6983f77a4141fc1fb466f39b4376109c27cd66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Courr=C3=A8ges-Anglas?= Date: Fri, 15 May 2015 12:26:53 +0200 Subject: [PATCH] Also log error messages from btrfs. Minor whitespace cleanup while here. --- libtisbackup/backup_rsync_btrfs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libtisbackup/backup_rsync_btrfs.py b/libtisbackup/backup_rsync_btrfs.py index 7cf93e9..354d332 100644 --- a/libtisbackup/backup_rsync_btrfs.py +++ b/libtisbackup/backup_rsync_btrfs.py @@ -215,14 +215,14 @@ class backup_rsync_btrfs(backup_generic): log = monitor_stdout(process,'',self) returncode = process.returncode if (returncode != 0): - self.logger.error("[" + self.backup_name + "] shell program exited with error code: %s"%log) - raise Exception("[" + self.backup_name + "] shell program exited with error code " + str(returncode), cmd) + self.logger.error("[" + self.backup_name + "] shell program exited with error code " + str(returncode)) + raise Exception("[" + self.backup_name + "] shell program exited with error code " + str(returncode), cmd, log[-512:]) else: - self.logger.info("[" + self.backup_name + "] snapshot directory created %s"%finaldest) + self.logger.info("[" + self.backup_name + "] snapshot directory created %s"%finaldest) else: print "btrfs snapshot of %s to %s"%(dest_dir,finaldest) else: - raise Exception('snapshot directory already exists : %s' %finaldest) + raise Exception('snapshot directory already exists : %s' %finaldest) self.logger.debug("[%s] touching datetime of target directory %s" ,self.backup_name,finaldest) print os.popen('touch "%s"' % finaldest).read() stats['backup_location'] = finaldest