498ac973e7e04e36f10f4e89014fcbc891205c0a

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

Message

Rework of duplicity-backup.conf.example, no functionality changes

Diff

This diff is truncated to protect this page.

  1diff --git a/duplicity-backup.conf.example b/duplicity-backup.conf.example
  2index 7dccd0330863e5248c55e706bbd7a080eb98558e..ca2e0aebe4fef837406cd0c754be32285d065f5f 100644
  3--- a/duplicity-backup.conf.example
  4+++ b/duplicity-backup.conf.example
  5@@ -2,7 +2,7 @@
  6 #
  7 # Copyright (c) 2008-2010 Damon Timm.
  8 # Copyright (c) 2010 Mario Santagiuliana.
  9-# Copyright (c) 2012-2013 Marc Gallet.
 10+# Copyright (c) 2012-2015 Marc Gallet.
 11 #
 12 # This program is free software: you can redistribute it and/or modify it under
 13 # the terms of the GNU General Public License as published by the Free Software
 14@@ -20,7 +20,7 @@
 15 # MORE ABOUT THIS SCRIPT AVAILABLE IN THE README AND AT:
 16 #
 17 # http://zertrin.org/projects/duplicity-backup/ (for this version)
 18-# http://damontimm.com/code/dt-s3-backup (for the original programi by Damon Timm)
 19+# http://damontimm.com/code/dt-s3-backup (for the original program by Damon Timm)
 20 #
 21 # Latest code available at:
 22 # http://github.com/zertrin/duplicity-backup
 23@@ -35,83 +35,51 @@
 24 # #############################################
 25 
 26 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 27-# ! DO NOT edit duplicity-backup.conf.example !
 28+# !           DO NOT edit this file!          !
 29+# !      (duplicity-backup.conf.example)      !
 30 # !    please copy it to anywhere you want    !
 31 # !     (typically duplicity-backup.conf)     !
 32-# !        and edit this file instead         !
 33+# !        and edit that copy instead         !
 34 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 35 
 36-# AMAZON S3 INFORMATION
 37-# Comment out these lines if you're not using Amazon S3
 38-AWS_ACCESS_KEY_ID="foobar_aws_key_id"
 39-AWS_SECRET_ACCESS_KEY="foobar_aws_access_key"
 40-
 41-# GOOGLE CLOUD STORAGE INFORMATION
 42-# Comment out these lines if you're not using Google Cloud storage
 43-GS_ACCESS_KEY_ID="foobar_gcs_key_id"
 44-GS_SECRET_ACCESS_KEY="foobar_gcs_secret_id"
 45-
 46-# OPENSTACK OBJECT STORAGE (SWIFT) INFORMATION
 47-# Comment out these lines if you're not using OpenStack Object Storage (Swift)
 48-SWIFT_USERNAME="foobar_swift_tenant:foobar_swift_username"
 49-SWIFT_PASSWORD="foobar_swift_password"
 50-SWIFT_AUTHURL="foobar_swift_authurl"
 51-SWIFT_AUTHVERSION="2"
 52-
 53-# S3CMD INFORMATION
 54-# Most people don't need this, but in some cases
 55-# you may want to specify a custom configuration file
 56-# to pass to s3cmd. If so, set the S3CMD_CONF_FILE variable
 57-# to the full path of this custom config file.
 58-# Per default s3cmd uses ${HOME}/.s3cfg
 59-# S3CMD_CONF_FILE='/path/to/your/s3cmd/conf/file'
 60-
 61-# ENCRYPTION INFORMATION
 62-# Do you want your backup to be encrypted? yes/no
 63-# If yes, please make sure you specify either PASSPHRASE or GPG_ENC_KEY/GPG_SIGN_KEY
 64-ENCRYPTION='yes'
 65-
 66-# If you are NOT running this from a cron, comment this line out
 67-# and duplicity should prompt you for your password.
 68-# Otherwise this password is either used for symmetric encryption
 69-# (your backups will be encrypted with this password) or is used
 70-# for the "GPG_SIGN_KEY" (see below).
 71-# Comment out if you aren't using encryption
 72-# Note: if you have a '$' in your passphrase, escape it with a '\'
 73-PASSPHRASE="foobar_gpg_passphrase"
 74-
 75-# Specify which GPG keys you would like to use (even if you have only one).
 76-# If you are running this from a cron, it is highly recommended to create separate
 77-# signature and encryption keys, because you have to specify the password for the
 78-# GPG_SIGN_KEY via the above PASSPHRASE variable
 79-# (see http://www.debian-administration.org/articles/209#d0e109).
 80-# If you are not running the script from a cron, duplicity should prompt you for the
 81-# GPG_SIGN_KEY password.
 82-# If you choose to use the same GPG key for encryption and signature, set it both
 83-# in GPG_ENC_KEY and GPG_SIGN_KEY.
 84-# Comment out if you're using only PASSPHRASE (symmetric encryption) or not using
 85-# encryption at all.
 86-GPG_ENC_KEY="foobar_gpg_key"
 87-GPG_SIGN_KEY="foobar_gpg_key"
 88-
 89-# Do you want to hide the key id of the encrypted files? yes/no
 90-# It uses the gpg's --hidden-recipient command to obfuscate the owner of the backup.
 91-# On restore, gpg will automatically try all available secret keys in order to
 92-# decrypt the backup. See gpg(1) for more details.
 93-# HIDE_KEY_ID='yes'
 94+#               .............
 95+#               .  WARNING  .
 96+#               .............
 97+#
 98+# duplicity-backup.sh IS NOT duplicity!
 99+#
100+# It is only a wrapper script for duplicity written in bash!
101+#
102+# This means the following:
103+#
104+#     * You need to install and configure duplicity BEFORE using duplicity-backup.sh
105diff --git a/duplicity-backup.sh b/duplicity-backup.sh
106index f8aeb6f925a686ea33b0c4b7524fcf2290d34c20..25ccecaab89954a00d78335928a10e6bf22f6150 100755
107--- a/duplicity-backup.sh
108+++ b/duplicity-backup.sh
109@@ -29,9 +29,13 @@
110 
111 # Default config file (don't forget to copy duplicity-backup.conf.example to
112 # match that path)
113-# NOTE: It can be useful not to edit this script at all to ease future updates
114-#       so the config file can be specified directly on the command line too
115-#       with the -c option.
116+#
117+# NOTE: It is RECOMMENDED to use the command line option -c to specify the
118+#       location of the config file. The CONFIG variable here is only used for
119+#       fallback purposes (look for the file named 'duplicity-backup.conf' in
120+#       the same folder as the script, if the option -c is not given).
121+#       It is DEPRECATED to edit this.
122+
123 CONFIG="duplicity-backup.conf"
124 
125 ##############################################################
126@@ -166,9 +170,11 @@ else
127   usage
128   exit 1
129 fi
130+
131 STATIC_OPTIONS="$DRY_RUN$STATIC_OPTIONS"
132 
133 SIGN_PASSPHRASE=$PASSPHRASE
134+
135 export AWS_ACCESS_KEY_ID
136 export AWS_SECRET_ACCESS_KEY
137 export GS_ACCESS_KEY_ID
138@@ -179,6 +185,7 @@ export SWIFT_AUTHURL
139 export SWIFT_AUTHVERSION
140 export PASSPHRASE
141 export SIGN_PASSPHRASE
142+
143 if [[ -n "$FTP_PASSWORD" ]]; then
144   export FTP_PASSWORD
145 fi
146@@ -223,11 +230,13 @@ size information unavailable."
147 NO_GSCMD_CFG="WARNING: gsutil is not configured, run 'gsutil config' \
148 in order to retrieve remote file size information. Remote file \
149 size information unavailable."
150+
151 NO_S3CMD="WARNING: s3cmd not found in PATH, remote file \
152 size information unavailable."
153 NO_S3CMD_CFG="WARNING: s3cmd is not configured, run 's3cmd --configure' \
154 in order to retrieve remote file size information. Remote file \
155 size information unavailable."
156+