Diff
1diff --git a/duplicity-backup.sh b/duplicity-backup.sh
2index 143b392ad3fc6b3236d3008fb02bff50db170960..235586bf34ba109747c335b6f75c3e65000bea03 100755
3--- a/duplicity-backup.sh
4+++ b/duplicity-backup.sh
5@@ -57,6 +57,7 @@ echo "USAGE:
6 the current working directory
7 -t, --time TIME specify the time from which to restore or list files
8 -n, --dry-run perform a trial run with no changes made
9+ -d, --debug echo duplicity commands to logfile
10
11 CURRENT SCRIPT VARIABLES:
12 ========================
13@@ -71,7 +72,7 @@ echo "USAGE:
14 # Some expensive argument parsing that allows the script to
15 # be insensitive to the order of appearance of the options
16 # and to handle correctly option parameters that are optional
17-while getopts ":c:t:bfvlsn-:" opt; do
18+while getopts ":c:t:bfvlsnd-:" opt; do
19 case $opt in
20 # parse long options (a bit tricky because builtin getopts does not
21 # manage long options and i don't want to impose GNU getopt dependancy)
22@@ -117,6 +118,9 @@ while getopts ":c:t:bfvlsn-:" opt; do
23 fi
24 ;;
25 dry-run)
26+ DRY_RUN="--dry-run "
27+ ;;
28+ debug)
29 ECHO=$(which echo)
30 ;;
31 *)
32@@ -132,7 +136,8 @@ while getopts ":c:t:bfvlsn-:" opt; do
33 v) COMMAND="verify";;
34 l) COMMAND="list-current-files";;
35 s) COMMAND="collection-status";;
36- n) ECHO=$(which echo);; # dry run
37+ n) DRY_RUN="--dry-run ";; # dry run
38+ d) ECHO=$(which echo);; # debug
39 :)
40 echo "Option -$OPTARG requires an argument." >&2
41 COMMAND=""
42@@ -153,6 +158,7 @@ else
43 usage
44 exit 1
45 fi
46+STATIC_OPTIONS="$DRY_RUN$STATIC_OPTIONS"
47
48 SIGN_PASSPHRASE=$PASSPHRASE
49 export AWS_ACCESS_KEY_ID