Diff
1diff --git a/duplicity-backup.sh b/duplicity-backup.sh
2index 3727c9b5b1165a91af9d0d77fb6bdec31e654505..562ba9cf96cd9bbab005c8338b243e3496a7cca5 100755
3--- a/duplicity-backup.sh
4+++ b/duplicity-backup.sh
5@@ -42,6 +42,12 @@ CONFIG="duplicity-backup.conf"
6 # Script Happens Below This Line - Shouldn't Require Editing #
7 ##############################################################
8
9+# make a backup of stdout and stderr for later
10+exec 6>&1
11+exec 7>&2
12+
13+# ------------------------------------------------------------
14+
15 usage(){
16 echo "USAGE:
17 $(basename "$0") [options]
18@@ -86,7 +92,7 @@ echo "USAGE:
19 EXCLIST (directories excluded) = ${EXCLIST[*]:0}
20 ROOT (root directory of backup) = ${ROOT}
21 LOGFILE (log file path) = ${LOGFILE}
22-" >&4
23+" >&6
24 }
25
26 DUPLICITY="$(which duplicity)"
27@@ -268,9 +274,6 @@ fi
28 # fd5 is never shown on screen but always logged (for delimiters in the log)
29 #
30
31-# make a backup of stderr for later
32-exec 6>&2
33-
34 # fd2 and fd3 are always logged and shown on screen via tee
35 # for fd2 (original stderr) the output of tee needs to be redirected to stderr
36 exec 2> >(tee -ia "${LOGFILE}" >&2)
37@@ -1050,6 +1053,6 @@ unset FTP_PASSWORD
38
39 # restore stdout and stderr to their original values
40 # and close the other fd
41-exec 1>&4 2>&6 3>&- 4>&- 5>&- 6>&-
42+exec 1>&6 2>&7 3>&- 4>&- 5>&- 6>&- 7>&-
43
44 # vim: set tabstop=2 shiftwidth=2 sts=2 autoindent smartindent: