Skip to content
Snippets Groups Projects
Commit 8fb94156 authored by intrigeri's avatar intrigeri
Browse files

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
parent 00e75943
No related branches found
No related tags found
No related merge requests found
...@@ -30,4 +30,4 @@ Matthew Palmer <mpalmer@debian.org> -- halt loglevel feature ...@@ -30,4 +30,4 @@ Matthew Palmer <mpalmer@debian.org> -- halt loglevel feature
dan@garthwaite.org -- reportspace bugfix dan@garthwaite.org -- reportspace bugfix
Tuomas Jormola <tj@solitudo.net> -- "when = manual" option Tuomas Jormola <tj@solitudo.net> -- "when = manual" option
Ian Beckwith <ianb@erislabs.net> -- dup bandwidthlimit fix Ian Beckwith <ianb@erislabs.net> -- dup bandwidthlimit fix
Olivier Berger <oberger@ouvaton.org> -- dup debug output bugfix Olivier Berger <oberger@ouvaton.org> -- dup debug output bugfix, reportinfo option
\ No newline at end of file \ No newline at end of file
...@@ -5,6 +5,8 @@ version 0.9.7 -- UNRELEASED ...@@ -5,6 +5,8 @@ version 0.9.7 -- UNRELEASED
. add 'when = manual' option, that can be used in the global config . 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 file or in a given backup action file. Thanks Tuomas Jormola for the
preliminary patch (Closes: #511299) 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 lib changes
easydialog: easydialog:
. Allow form fields input to grow up to 100 chars (Closes: #562249) . Allow form fields input to grow up to 100 chars (Closes: #562249)
......
...@@ -21,6 +21,10 @@ reportemail = root ...@@ -21,6 +21,10 @@ reportemail = root
# even if all modules reported success. (default = yes) # even if all modules reported success. (default = yes)
reportsuccess = 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 # if set to 'yes', a report email will be generated
# even if there was no error. (default = yes) # even if there was no error. (default = yes)
reportwarning = yes reportwarning = yes
......
...@@ -335,8 +335,9 @@ function process_action() { ...@@ -335,8 +335,9 @@ function process_action() {
_errors=`cat $bufferfile | grep "^Error: " | wc -l` _errors=`cat $bufferfile | grep "^Error: " | wc -l`
_fatals=`cat $bufferfile | grep "^Fatal: " | wc -l` _fatals=`cat $bufferfile | grep "^Fatal: " | wc -l`
_halts=`cat $bufferfile | grep "^Halt: " | 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 rm $bufferfile
if [ $_halts != 0 ]; then if [ $_halts != 0 ]; then
msg "*halt* -- $file" msg "*halt* -- $file"
...@@ -356,6 +357,9 @@ function process_action() { ...@@ -356,6 +357,9 @@ function process_action() {
warning "<<<< finished action $file: WARNING" warning "<<<< finished action $file: WARNING"
else else
msg "success -- $file" 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" info "<<<< finished action $file: SUCCESS"
fi fi
...@@ -456,6 +460,7 @@ getconf reportemail ...@@ -456,6 +460,7 @@ getconf reportemail
getconf reporthost getconf reporthost
getconf reportspace getconf reportspace
getconf reportsuccess yes getconf reportsuccess yes
getconf reportinfo no
getconf reportuser getconf reportuser
getconf reportwarning yes getconf reportwarning yes
getconf loglevel 3 getconf loglevel 3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment