aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2010-01-05 13:39:32 +0100
committerintrigeri <intrigeri@boum.org>2010-01-05 13:39:32 +0100
commit8fb9415609b3181d8522f42115508dd7a3643345 (patch)
tree5674eb8ced0286cecf39e33d9595664bdc7b7107
parent00e759430a1812bd5a2ca8dc5cc8e5046330c10b (diff)
downloadbackupninja-8fb9415609b3181d8522f42115508dd7a3643345.tar.gz
backupninja-8fb9415609b3181d8522f42115508dd7a3643345.tar.bz2
Adding optional report of infos sent by handlers in the email (closes #563734)
Cherry-picked and re-indented patch 76792c8f45afa1fdaeb81c2af77499ca0b83ce64 from Olivier Berger. Conflicts: src/backupninja.in
-rw-r--r--AUTHORS2
-rw-r--r--ChangeLog2
-rw-r--r--etc/backupninja.conf.in4
-rwxr-xr-xsrc/backupninja.in7
4 files changed, 13 insertions, 2 deletions
diff --git a/AUTHORS b/AUTHORS
index 6309a1c..89b505f 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -30,4 +30,4 @@ Matthew Palmer <mpalmer@debian.org> -- halt loglevel feature
dan@garthwaite.org -- reportspace bugfix
Tuomas Jormola <tj@solitudo.net> -- "when = manual" option
Ian Beckwith <ianb@erislabs.net> -- dup bandwidthlimit fix
-Olivier Berger <oberger@ouvaton.org> -- dup debug output bugfix \ No newline at end of file
+Olivier Berger <oberger@ouvaton.org> -- dup debug output bugfix, reportinfo option \ No newline at end of file
diff --git a/ChangeLog b/ChangeLog
index b6e05d0..b71a9be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@ version 0.9.7 -- UNRELEASED
. add 'when = manual' option, that can be used in the global config
file or in a given backup action file. Thanks Tuomas Jormola for the
preliminary patch (Closes: #511299)
+ . new reportinfo option: when set, messages sent by handlers with
+ "info" are included in the report e-mail (closes #563734)
lib changes
easydialog:
. Allow form fields input to grow up to 100 chars (Closes: #562249)
diff --git a/etc/backupninja.conf.in b/etc/backupninja.conf.in
index f7668a5..de1fbf3 100644
--- a/etc/backupninja.conf.in
+++ b/etc/backupninja.conf.in
@@ -21,6 +21,10 @@ reportemail = root
# even if all modules reported success. (default = yes)
reportsuccess = yes
+# if set to 'yes', info messages from handlers will be
+# sent into the email (default = no)
+reportinfo = no
+
# if set to 'yes', a report email will be generated
# even if there was no error. (default = yes)
reportwarning = yes
diff --git a/src/backupninja.in b/src/backupninja.in
index a991f58..f871e0c 100755
--- a/src/backupninja.in
+++ b/src/backupninja.in
@@ -335,8 +335,9 @@ function process_action() {
_errors=`cat $bufferfile | grep "^Error: " | wc -l`
_fatals=`cat $bufferfile | grep "^Fatal: " | wc -l`
_halts=`cat $bufferfile | grep "^Halt: " | wc -l`
+ _infos=`cat $bufferfile | grep "^Info: " | wc -l`
- ret=`grep "\(^Warning: \|^Error: \|^Fatal: \|Halt: \)" $bufferfile`
+ ret=`grep "\(^Info: \|^Warning: \|^Error: \|^Fatal: \|Halt: \)" $bufferfile`
rm $bufferfile
if [ $_halts != 0 ]; then
msg "*halt* -- $file"
@@ -356,6 +357,9 @@ function process_action() {
warning "<<<< finished action $file: WARNING"
else
msg "success -- $file"
+ if [ $_infos != 0 -a "$reportinfo" == "yes" ]; then
+ errormsg="$errormsg\n== infos from $file ==\n\n$ret\n"
+ fi
info "<<<< finished action $file: SUCCESS"
fi
@@ -456,6 +460,7 @@ getconf reportemail
getconf reporthost
getconf reportspace
getconf reportsuccess yes
+getconf reportinfo no
getconf reportuser
getconf reportwarning yes
getconf loglevel 3