7aa30b2e27a01fc408dcef9255e70fed5ee034d1
- Author
- Zertrin <zertrin@gmail.com>
- Committer
- Zertrin <zertrin@gmail.com>
- Date
Message
Added support for including the config file (if specified and existing) in the encrypted tarball when backuping the script
Diff
1diff --git a/duplicity-backup.sh b/duplicity-backup.sh
2index 851128f62bd992a0c85b1fe77ffca840f31189ad..4a851ff61bf76c8ddc08e73cda65beef69ce1900 100755
3--- a/duplicity-backup.sh
4+++ b/duplicity-backup.sh
5@@ -394,7 +394,13 @@ backup_this_script()
6 echo "You are backing up: "
7 echo " 1. ${SCRIPTPATH}"
8 echo " 2. GPG Secret Key: ${GPG_KEY}"
9- echo "Backup will be saved to: `pwd`/${TMPFILENAME}"
10+
11+ if [ ! -z "$CONFIG" -a -f "$CONFIG" ];
12+ then
13+ echo " 3. Config file: ${CONFIG}"
14+ fi
15+
16+ echo "Backup tarball will be encrypted and saved to: `pwd`/${TMPFILENAME}"
17 echo
18 echo ">> Are you sure you want to do that ('yes' to continue)?"
19 read ANSWER
20@@ -405,6 +411,12 @@ backup_this_script()
21
22 mkdir -p ${TMPDIR}
23 cp $SCRIPTPATH ${TMPDIR}/
24+
25+ if [ ! -z "$CONFIG" -a -f "$CONFIG" ];
26+ then
27+ cp $CONFIG ${TMPDIR}/
28+ fi
29+
30 gpg -a --export-secret-keys ${GPG_KEY} > ${TMPDIR}/duplicity-backup-secret.key.txt
31 echo -e ${README_TXT} > ${README}
32 echo "Encrypting tarball, choose a password you'll remember..."