5d2012863444364a6e980ab2a69ee9b6de2f589a

Author
zertrin <zertrin@gmail.com>
Committer
zertrin <zertrin@gmail.com>
Date

Message

Improve some of the new comments about the new logging

Diff

 1diff --git a/duplicity-backup.sh b/duplicity-backup.sh
 2index e02777cc5cafddc2d1fbc6b3c589c5da6bd5d223..2e2d68c9cabeda4d9a322011802237264699fbe5 100755
 3--- a/duplicity-backup.sh
 4+++ b/duplicity-backup.sh
 5@@ -71,9 +71,9 @@ echo "USAGE:
 6     --backup-script            automatically backup the script and secret key(s) to
 7                                the current working directory
 8 
 9-    -q, --quiet                standard output is only written to the logfile and
10-                               is not shown. standard error will still be logged and
11-                               shown.
12+    -q, --quiet                silence most of output messages, except errors and output
13+                               that is intended for interactive usage. Silenced output
14+                               is still logged in the logfile.
15 
16     -n, --dry-run              perform a trial run with no changes made
17     -d, --debug                echo duplicity commands to logfile
18@@ -251,14 +251,9 @@ fi
19 #
20 #  QUIET mode ON  | shown on screen | not shown on screen
21 #  ---------------+-----------------+----------------------
22-#  logged         |   fd2 and fd3   |      fd1, fd5
23+#  logged         |    fd2, fd3     |      fd1, fd5
24 #  not logged     |      fd4        |         -
25 #
26-# fd1 is stdout and is not shown if QUIET, but still logged
27-# fd2 is stderr and is always shown on screen and logged
28-# fd3 is like stdout but always shown on screen
29-# fd4 is always shown on sceen but never logged (for interactive prompts)
30-#
31 #  ##### Redirection matrix in the case when quiet mode is OFF #####
32 #
33 #  QUIET mode OFF | shown on screen | not shown on screen
34@@ -273,15 +268,13 @@ fi
35 # fd5 is never shown on screen but always logged (for delimiters in the log)
36 #
37 
38-# fd2 and fd3 are always logged and shown on screen via tee
39-
40 # make a backup of stderr for later
41 exec 6>&2
42 
43+# fd2 and fd3 are always logged and shown on screen via tee
44 # for fd2 (original stderr) the output of tee needs to be redirected to stderr
45 exec 2> >(tee -ia "${LOGFILE}" >&2)
46-
47-# here we can leave the output of tee to stdout
48+# create fd3 as a redirection to stdout and the logfile via tee
49 exec 3> >(tee -ia "${LOGFILE}")
50 
51 # create fd4 as a copy of stdout, but that won't be redirected to tee