From e732e8475002c73f2eb66a073a7efb6f200a3360 Mon Sep 17 00:00:00 2001
From: intrigeri <intrigeri@boum.org>
Date: Tue, 9 Jul 2013 19:45:29 +0000
Subject: [PATCH] rdiff.helper: add output_as_info support.

Thanks to David Gasaway <dave@gasaway.org> for the patch!
---
 handlers/rdiff.helper.in | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/handlers/rdiff.helper.in b/handlers/rdiff.helper.in
index 1597305d..27459d01 100644
--- a/handlers/rdiff.helper.in
+++ b/handlers/rdiff.helper.in
@@ -282,12 +282,33 @@ do_rdiff_con() {
    setDefault finish
 }
 
+do_rdiff_adv() {
+   booleanBox "$rdiff_title" "Should backupninja write program output as Info messages rather than Debug messages?" no
+   if [ $? = 0 ]; then
+      rdiff_output_as_info=yes
+   else
+      rdiff_output_as_info=no
+   fi
+}
+
 do_rdiff_finish() {
    get_next_filename $configdirectory/90.rdiff
    cat > $next_filename <<EOF
 # options = --force
 # when = everyday at 02
 
+## should backupninja write program output as Info messages rather than Debug
+## messages? (default: no)
+## Usually rdiff-backup output (for increment expiration and backup) is written
+## to output as Debug messages; this option causes backupninja to use Info-level
+## messages instead. Since backup reports include Info messages, this option is
+## useful to receive output like rdiff-backup session statistics in reports. In
+## addition, since rdiff-backup has a habit of using a zero exit code when
+## non-fatal errors are encountered (causing backupninja to conclude the backup
+## was entirely successful), this option is useful for inspecting non-fatal
+## filesystem and permission errors from rdiff-backup.
+output_as_info = $rdiff_output_as_info
+
 [source]
 type = local
 keep = $rdiff_keep
@@ -378,6 +399,7 @@ rdiff_main_menu() {
          src "$srcitem" \
          dest "$destitem" \
          conn "$conitem" \
+         adv "$advitem" \
          finish "finish and create config file"
       [ $? = 0 ] || return
       result="$REPLY"
@@ -411,6 +433,7 @@ rdiff_wizard() {
    rdiff_type=remote
    rdiff_user=
    rdiff_host=
+   rdiff_output_as_info="no"
 
    # Global variables whose '*' shall not be expanded
    set -o noglob
-- 
GitLab