3a52bf037431217af33cab9358d81b04b15610ea

Author
Mario Santagiuliana <mario@marionline.it>
Committer
Mario Santagiuliana <mario@marionline.it>
Date

Message

Merge branch 'master' of git://github.com/thornomad/dt-s3-backup

Diff

  1diff --git a/CHANGELOG b/CHANGELOG
  2index 54c388e4fdd4de09ef91a560046fd5fccfd44e6b..b1ea7c4fd787492109a11ada18555993aaabfcdc 100644
  3--- a/CHANGELOG
  4+++ b/CHANGELOG
  5@@ -1,38 +1,41 @@
  6-Version Four (marionline)
  7-	* Add --list-files to view in the standart-output files stored in my archive
  8-	* Modification on --restore: if I provide a path to --restore option I don't want to answare a confermation question too
  9-
 10-Version Four (0.4)
 11+0.4 Version Four (03/13/10)
 12+===========================
 13 
 14 	* Moved the source code to github
 15-	* Added command line --restore to path (rather than script specific)
 16-	* Added --restore-file option
 17+	* Add --list-files to view in the standart-output files stored in my archive [mariononline]
 18+	* Added ECHO command to troublshoot the code when needed
 19+	* Added command line --restore to path & removed RESTORE variable [mariononline]
 20+	* Added --restore-file option [mariononline]
 21 	* Changed --backup-this-script to --backup-scrip
 22 	* Added README to --backup-script
 23 	* Force use of --backup option (no accidently running the script)
 24+	* Added help text to the command line script itself [mariononline]
 25 	* Script without options shows --help and current directory settings
 26-	* Removed the RESTORE variable from the script (command line now)
 27-	* Removed --test option (can't remember what it is for)
 28+	* Script checks to make sure you have put some variables in before it runs [mariononline]
 29+	* A number of other minor changes
 30 
 31 Version Three (01/31/09)
 32+========================
 33 
 34-    1. Added comment to explain why folks need to use s3+ and not s3: for Amazon buckets
 35-    2. Used "unset" to remove the variables at end of the script
 36-    3. Fixed a problem when the backup folder on S3 was nested inside another bucket
 37-    4. Changed the PASSPHRASE field to default to the actual passphrase, so one can easily backup the entire script and not have to worry about the passphrase.
 38-    5. Added --backup-this-script option which will turn the script and the secret key into an encrypted tarball that can be kept somewhere safe for easy restores if the machine goes down.
 39-    6. Cleaned up the get_file_size function so it wouldn't run when it wasn't supposed to.
 40+	* Added comment to explain why folks need to use 's3+' and not 's3:' for Amazon buckets
 41+	* Used "unset" to remove the variables at end of the script
 42+	* Fixed a problem when the backup folder on S3 was nested inside another bucket
 43+	* Changed the PASSPHRASE field to default to the actual passphrase, so one can easily backup the entire script and not have to worry about the passphrase.
 44+	* Added --backup-this-script option which will turn the script and the secret key into an encrypted tarball that can be kept somewhere safe for easy restores if the machine goes down.
 45+	* Cleaned up the get_file_size function so it wouldn't run when it wasn't supposed to.
 46 
 47 Version Two (12/03/08)
 48+======================
 49 
 50-   1. added GPL license
 51-   2. changed the cleanup feature to automatically force a full backup after (n) number of days as well as automatically cleanup after (n) number of days
 52-   3. added option to force cleanup after (n) number of full backups (rather than by days)
 53-   4. option to changed log file ownership
 54-   5. runtime checks for installed required software and write permissions on log directory
 55-   6. fixed formatting of logfile to be a little more consistent
 56-   7. setup everything in clever functions
 57+	* added GPL license
 58+	* changed the cleanup feature to automatically force a full backup after (n) number of days as well as automatically cleanup after (n) number of days
 59+	* added option to force cleanup after (n) number of full backups (rather than by days)
 60+	* option to changed log file ownership
 61+	* runtime checks for installed required software and write permissions on log directory
 62+	* fixed formatting of logfile to be a little more consistent
 63+	* setup everything in clever functions
 64 
 65 Version One (11/24/08)
 66+======================
 67 
 68-   1. Initial release.
 69+* Initial release.
 70diff --git a/README b/README
 71index e6ef682fa7faaa1bee0cbe6469f354c35e4cf642..83ec4bb5f40eace16cc644e64d046351c3c2b07d 100644
 72--- a/README
 73+++ b/README
 74@@ -20,14 +20,23 @@ http://github.com/thornomad/dt-s3-backup
 75 BEFORE YOU START
 76 ================
 77 
 78-This is a bash script that requires user configuration.  Instructions are in
 79+This script requires user configuration.  Instructions are in
 80 the file itself and should be self-explanatory.  Be sure to replace all the
 81 *foobar* values with your real ones.  Almost every value needs to be
 82-configured.
 83+configured in someway.
 84 
 85-After the script is configured, you can move it to /usr/local/sbin/ or wherever
 86-you please and run it from there.  A cron job is always nice.  Be sure to make
 87-the script executable (chmod +x) before you hit the gas.
 88+You can use multiple copies of the script with different settings for different
 89+backup scenarios.  It is designed to run as a cron job and will log information
 90+to a text file (including remote file sizes, if you have s3cmd installed).  Be
 91+sure to make the script executable (chmod +x) before you hit the gas.
 92+
 93+REQUIREMENTS
 94+============
 95+
 96+* duplicity
 97+* gpg
 98+* Amazon S3 
 99+* s3cmd (optional)
100 
101 COMMON USAGE EXAMPLES
102 =====================
103@@ -38,6 +47,9 @@ COMMON USAGE EXAMPLES
104 * Run an incremental backup:
105 	$ dt-s3-backup.sh --backup
106 
107+* Force a one-off full backup:
108+    $ dt-s3-backup.sh --full
109+
110 * Restore your entire backup:
111 	$ dt-s3-backup.sh --restore 
112     You will be prompted for a restore directory
113@@ -61,6 +73,8 @@ COMMON USAGE EXAMPLES
114 * Verify the backup
115     $ dt-s3-backup.sh --verify
116 
117+* Backup the script and gpg key (for safekeeping)
118+    $ dt-s3-backup.sh --backup-script
119 
120 NEXT VERSION WISH LIST
121 ======================
122diff --git a/dt-s3-backup.sh b/dt-s3-backup.sh
123index 591600665a9d75eec81917a437b752e50bc810c8..a1a669a1863e565c947c00d13f8ad07d1cd69b5b 100755
124--- a/dt-s3-backup.sh
125+++ b/dt-s3-backup.sh
126@@ -100,8 +100,13 @@ LOG_FILE="duplicity-`date +%Y-%m-%d-%M`.txt"
127 LOG_FILE_OWNER="foobar_user_name:foobar_user_name"
128 VERBOSITY="-v3"
129 
130-# END OF USER EDITS
131-
132+# TROUBLESHOOTING: If you are having any problems running this script it is
133+# helpful to see the command output that is being generated to determine if the
134+# script is causing a problem or if it is an issue with duplicity (or your
135+# setup).  Simply  uncomment the ECHO line below and the commands will be
136+# printed to the logfile.  This way, you can see if the problem is with the
137+# script or with duplicity.
138+#ECHO=$(which echo)
139 
140 ##############################################################
141 # Script Happens Below This Line - Shouldn't Require Editing # 
142@@ -198,7 +203,7 @@ include_exclude()
143 duplicity_cleanup() 
144 {
145   echo "-----------[ Duplicity Cleanup ]-----------" >> ${LOGFILE}
146-  ${DUPLICITY} ${CLEAN_UP_TYPE} ${CLEAN_UP_VARIABLE} --force \
147+  ${ECHO} ${DUPLICITY} ${CLEAN_UP_TYPE} ${CLEAN_UP_VARIABLE} --force \
148 	    --encrypt-key=${GPG_KEY} \
149 	    --sign-key=${GPG_KEY} \
150 	    ${DEST} >> ${LOGFILE}
151@@ -207,7 +212,7 @@ duplicity_cleanup()
152 
153 duplicity_backup()
154 {
155-  ${DUPLICITY} ${OPTION} ${VERBOSITY} ${STATIC_OPTIONS} \
156+  ${ECHO} ${DUPLICITY} ${OPTION} ${VERBOSITY} ${STATIC_OPTIONS} \
157   --encrypt-key=${GPG_KEY} \
158   --sign-key=${GPG_KEY} \
159   ${EXCLUDE} \
160@@ -414,9 +419,12 @@ fi
161 
162 echo -e "--------    END DT-S3-BACKUP SCRIPT    --------\n" >> ${LOGFILE}
163 
164+if [ ${ECHO} ]; then
165+  echo "TEST RUN ONLY: Check the logfile for command output."
166+fi
167+
168 unset AWS_ACCESS_KEY_ID
169 unset AWS_SECRET_ACCESS_KEY
170 unset PASSPHRASE
171 
172 # vim: set tabstop=2 shiftwidth=2 sts=2 autoindent smartindent: 
173-# EOF