bafc5c17d57aa367ba8907629fec9eb3ebdc6d05

Author
Nace Oroz <nace.oroz@gmail.com>
Committer
Nace Oroz <nace.oroz@gmail.com>
Date

Message

Support for backup without encryption and locations other than s3

Diff

This diff is truncated to protect this page.

  1diff --git a/dt-s3-backup.sh b/dt-s3-backup.sh
  2index 7322784d4f58d28e05391bbb7b61ffeaba95d771..cb8df0b2c8dea4a14435429ba6d034e8f1a67f2e 100755
  3--- a/dt-s3-backup.sh
  4+++ b/dt-s3-backup.sh
  5@@ -23,20 +23,26 @@
  6 # ---------------------------------------------------------------------------- #
  7 
  8 # AMAZON S3 INFORMATION
  9-export AWS_ACCESS_KEY_ID="foobar_aws_key_id"
 10-export AWS_SECRET_ACCESS_KEY="foobar_aws_access_key"
 11+# Comment out this lines if you're not using S3
 12+#export AWS_ACCESS_KEY_ID=" "
 13+#export AWS_SECRET_ACCESS_KEY=" "
 14 
 15 # If you aren't running this from a cron, comment this line out
 16 # and duplicity should prompt you for your password.
 17-export PASSPHRASE="foobar_gpg_passphrase"
 18+# Comment out if you're not using encryption
 19+#export PASSPHRASE="foobar_gpg_passphrase"
 20 
 21 # Specify which GPG key you would like to use (even if you have only one).
 22-GPG_KEY="foobar_gpg_key"
 23+# Comment out if you're not using encryption
 24+#GPG_KEY=" "
 25+
 26+# Do you want your backup to be encrypted? yes/no
 27+ENCRYPTION='no'
 28 
 29 # The ROOT of your backup (where you want the backup to start);
 30 # This can be / or somwhere else -- I use /home/ because all the
 31 # directories start with /home/ that I want to backup.
 32-ROOT="/home/"
 33+ROOT="/"
 34 
 35 # BACKUP DESTINATION INFORMATION
 36 # In my case, I use Amazon S3 use this - so I made up a unique
 37@@ -47,7 +53,12 @@ ROOT="/home/"
 38 # NOTE: You do need to keep the "s3+http://<your location>/" format
 39 # even though duplicity supports "s3://<your location>/".
 40 #DEST="s3+http://backup-bucket/backup-folder/"
 41-DEST="file:///home/foobar_user_name/new-backup-test/"
 42+
 43+# Other possible locations
 44+#DEST="ftp://user[:password]@other.host[:port]/some_dir"
 45+#DEST="rsync://user@host.com[:port]//absolute_path"
 46+#DEST="ssh://user[:password]@other.host[:port]/[/]some_dir"
 47+DEST="file:///tmp/sranje"
 48 
 49 # INCLUDE LIST OF DIRECTORIES
 50 # Here is a list of directories to include; if you want to include
 51@@ -61,14 +72,12 @@ DEST="file:///home/foobar_user_name/new-backup-test/"
 52 #        )
 53 #
 54 # Simpler example with one location:
 55-INCLIST=( "/home/foobar_user_name/Documents/Prose/" ) 
 56+INCLIST=( "/etc" ) 
 57 
 58 # EXCLUDE LIST OF DIRECTORIES
 59 # Even though I am being specific about what I want to include,
 60 # there is still a lot of stuff I don't need.
 61-EXCLIST=(   "/home/*/Trash" \
 62-            "/home/*/Projects/Completed" \
 63-            "/**.DS_Store" "/**Icon?" "/**.AppleDouble" \
 64+EXCLIST=( 
 65         )
 66 
 67 # STATIC BACKUP OPTIONS
 68@@ -76,7 +85,7 @@ EXCLIST=(   "/home/*/Trash" \
 69 # duplicity.  I use both the `--full-if-older-than` option plus the
 70 # `--s3-use-new-style` option (for European buckets).  Be sure to separate your
 71 # options with appropriate spacing.
 72-STATIC_OPTIONS="--full-if-older-than 14D --s3-use-new-style"
 73+STATIC_OPTIONS="--full-if-older-than 14D"
 74 
 75 # FULL BACKUP & REMOVE OLDER THAN SETTINGS
 76 # Because duplicity will continue to add to each backup as you go,
 77@@ -98,9 +107,9 @@ CLEAN_UP_VARIABLE="2"
 78 # I run this script as root, but save the log files under my user name --
 79 # just makes it easier for me to read them and delete them as needed.
 80 
 81-LOGDIR="/home/foobar_user_name/logs/test2/"
 82+LOGDIR="/tmp/dupl_log/"
 83 LOG_FILE="duplicity-`date +%Y-%m-%d_%H-%M`.txt"
 84-LOG_FILE_OWNER="foobar_user_name:foobar_user_name"
 85+LOG_FILE_OWNER="root:root"
 86 VERBOSITY="-v3"
 87 
 88 # EMAIL ALERT (*thanks: rmarescu*)
 89@@ -131,6 +140,12 @@ DUPLICITY="$(which duplicity)"
 90 S3CMD="$(which s3cmd)"
 91 MAIL="$(which mailx)"
 92 
 93+if [ $ENCRYPTION = "yes" ]; then
 94+  ENCRYPT="--encrypt-key=${GPG_KEY} --sign-key=${GPG_KEY}"
 95+elif [ $ENCRYPTION = "no" ]; then
 96+  ENCRYPT="--no-encryption"
 97+fi
 98+
 99 NO_S3CMD="WARNING: s3cmd is not installed, remote file \
100 size information unavailable."
101 NO_S3CMD_CFG="WARNING: s3cmd is not configured, run 's3cmd --configure' \
102@@ -220,8 +235,7 @@ duplicity_cleanup()
103 {
104   echo "-----------[ Duplicity Cleanup ]-----------" >> ${LOGFILE}