4e9b44ddc1b76a8118fb600b6999d11548c56647

Author
Damon Timm <damontimm@gmail.com>
Committer
Damon Timm <damontimm@gmail.com>
Date

Message

lots of changes for version 4 - ready for final testing then tag it

Diff

This diff is truncated to protect this page.

  1diff --git a/AUTHORS b/AUTHORS
  2new file mode 100644
  3index 0000000000000000000000000000000000000000..71475a0359ec44f1b97a469bae335d314d8353be
  4--- /dev/null
  5+++ b/AUTHORS
  6@@ -0,0 +1,2 @@
  7+Damon Timm <damontimm@gmail.com> <http://blog.damontimm.com> 
  8+Mario Santagiuliana <mario@marionline.it> <http://www.marionline.it>
  9diff --git a/README b/README
 10index 854ba16a7457b88124ea3e2c8dad060ce7b15ca5..542ba1607395824faea227998e3ccf13d581ce7a 100644
 11--- a/README
 12+++ b/README
 13@@ -1,53 +1,72 @@
 14-**NOTE: currently, the script is undergoing some changes!  You should use version 3 (0.3) for the time being until we have all the bugs/kinks sorted out.
 15+ABOUT THIS SCRIPT
 16+=================
 17 
 18-More information about this script avaiable at: http://damontimm.com/code/dt-s3-backup
 19+This bash script was designed to automate and simplify the remote backup
 20+process of duplicity on Amazon S3.  After your script is configured, you can
 21+easily backup, restore, verify and clean (either via cron or manually) your
 22+data without having to remember lots of different command options and
 23+passphrases.
 24 
 25-==TO DO==
 26+Most importantly, you can easily backup the script and your gpg key in a
 27+convienent passphrase-encrypted file.  This comes in in handy if/when your
 28+machine ever does go belly up. 
 29 
 30-* Add a README file to the "--backup-this-script" option because, if you are like me, when it is working for so long I forget what to do when it comes time to restore
 31-* Add --restore-dir option
 32-* --restore-file restores to the *original* location if not alternate location is specified ... may make more sense to have it restore the current working directory first.
 33-* add option to be able to restore a file from a specific time period (not just the latest version)
 34+More information about this script avaiable at:
 35+http://damontimm.com/code/dt-s3-backup
 36 
 37-=== USAGE EXAMPLE ===
 38-You must configure the script before using it you can config it with your favorites test editor(read comments in script).
 39-You can put the script under bin directory of your user. If you have configured correctly your shell you will call dt-s3-backup.sh whenever you want.
 40-Then make the script executable with "chmod +x".
 41+Latest version of the code is available at:
 42+http://github.com/thornomad/dt-s3-backup
 43 
 44-==Common usage==
 45+BEFORE YOU START
 46+================
 47 
 48-= View help
 49-	$ dt-s3-backup.sh
 50+This is a bash script that requires user configuration.  Instructions are in
 51+the file itself and should be self-explanatory.  Be sure to replace all the
 52+*foobar* values with your real ones.  Almost every value needs to be
 53+configured.
 54 
 55-= Run an incremental backup of configured directory
 56+After the script is configured, you can move it to /usr/local/sbin/ or wherever
 57+you please and run it from there.  A cron job is always nice.  Be sure to make
 58+the script executable (chmod +x) before you hit the gas.
 59+
 60+COMMON USAGE EXAMPLES
 61+=====================
 62+
 63+* View help:
 64+    $ dt-s3-backup.sh
 65+
 66+* Run an incremental backup:
 67 	$ dt-s3-backup.sh --backup
 68 
 69-= Restore your backup
 70-To restore the backup in the current work directory just run:
 71-	$ dt-s3-backup.sh --restore ./
 72+* Restore your entire backup:
 73+	$ dt-s3-backup.sh --restore 
 74+    You will be prompted for a restore directory
 75 
 76-You can provide another directory to restore, for example: I want to restore my backup in "my_restore" folder (not created yet or existing):
 77-	$ dt-s3-backup.sh --restore my_restore
 78+	$ dt-s3-backup.sh --restore /home/user/restore-folder
 79+    You can also provide a restore folder on the command line.
 80 
 81-If you don't provide a path you will prompt to answare some question to restore your backup
 82+* Restore a specific file in the backup:
 83+    $ dt-s3-backup.sh --restore-file
 84+    You will be prompted for a file to restore to the current directory
 85 
 86-==Special usage==
 87+    $ dt-s3-backup.sh --restore-file img/mom.jpg
 88+    Restores the file img/mom.jpg to the current directory
 89 
 90-= List files beckend up in the remote archive
 91+    $ dt-s3-backup.sh --restore-file img/mom.jpg /home/user/i-love-mom.jpg
 92+    Restores the file img/mom.jpg to /home/user/i-love-mom.jpg
 93+
 94+* List files in the remote archive
 95 	$ dt-s3-backup.sh --list-current-files
 96 
 97-= Restore a specific file
 98-I have deleted my favourites picture file 'mygirlfriend.jpg' present in my "Pictures" home directory, I backup it with dt-s3-backup and I can restore it with:
 99-	$ dt-s3-backup.sh --restore-file Pictures/mygirlfriend.jpg
100+* Verify the backup
101+    $ dt-s3-backup.sh --verify
102+
103+
104+NEXT VERSION WISH LIST
105+======================
106 
107-Now mygirlfriend.jpg is under "Pictures" directory.
108-But if I want to change the name when I restore it? I just need to provide a new name:
109-	$ dt-s3-backup.sh --restore-file Pictures/mygirlfriend.jpg Pictures/myExgirlfriend.jpg
110+* --restore-dir option
111+* restore files from a specific time period 
112 
113diff --git a/dt-s3-backup.sh b/dt-s3-backup.sh
114index 2f226bbce5619feca4a17e4b3f00c522b2b462eb..a2e5ed151347188819e82e4a1d59911a5335435b 100755
115--- a/dt-s3-backup.sh
116+++ b/dt-s3-backup.sh
117@@ -15,49 +15,22 @@
118 #
119 # You should have received a copy of the GNU General Public License along with
120 # this program.  If not, see <http://www.gnu.org/licenses/>.
121-
122-# ---------------------------------------------------------------------------- #
123-
124-# AUTHORS:
125-
126-# Damon Timm <damontimm@gmail.com> <http://blog.damontimm.com> 
127-# Mario Santagiuliana <mario@marionline.it> <http://www.marionline.it>
128-
129-# VERSION 4 NOTE (02/12/2010):
130-
131-# **Code is still being tested - if you want the last stable version, please
132-# download verion 0.3!**
133-
134-# ABOUT THIS SCRIPT:
135-#
136-# This bash script was designed to automate and simplify the remote backup
137-# process using duplicity and Amazon S3.  Hopefully, after the script is
138-# configured, you can easily backup, restore, verify and clean without having
139-# to remember lots of different command options.
140 #
141-# Furthermore, you can even automate the process of saving your script and the
142-# gpg key for your backups in a single password-protected file -- this way, you
143-# know you have everything you need for a restore, in case your machine goes
144-# down.
145-#
146-# You can run the script from cron with no command-line options (all options
147-# set in the script itself); however, you can also run it outside of the cron
148-# with some variables for more control.
149-
150-# MORE INFORMATION:
151+# MORE ABOUT THIS SCRIPT AVAILABLE IN THE README AND AT:
152 #
153 # http://damontimm.com/code/dt-s3-backup
154-
155+#
156 # ---------------------------------------------------------------------------- #
157 
158 # AMAZON S3 INFORMATION
159 export AWS_ACCESS_KEY_ID="foobar_aws_key_id"
160 export AWS_SECRET_ACCESS_KEY="foobar_aws_access_key"
161 
162-# GPG PASSPHRASE & GPG KEY (Automatic/Cron Usage)
163 # If you aren't running this from a cron, comment this line out
164 # and duplicity should prompt you for your password.
165 export PASSPHRASE="foobar_gpg_passphrase"
166+
167+# Specify which GPG key you would like to use (even if you have only one).
168 GPG_KEY="foobar_gpg_key"
169 
170 # The ROOT of your backup (where you want the backup to start);
171@@ -71,15 +44,14 @@ ROOT="/home/"
172 # for you).  If you don't want to use Amazon S3, you can backup 
173 # to a file or any of duplicity's supported outputs.
174 #
175-# NOTE: You do need to keep the "s3+http://<your location>/" format;
176-# even though duplicity supports "s3://<your location>/" this script
177-# needs to read the former.
178-DEST="file:///home/foobar_user_name/new-backup-test/"
179+# NOTE: You do need to keep the "s3+http://<your location>/" format
180+# even though duplicity supports "s3://<your location>/".
181 #DEST="s3+http://backup-bucket/backup-folder/"
182+DEST="file:///home/foobar_user_name/new-backup-test/"
183 
184 # INCLUDE LIST OF DIRECTORIES
185 # Here is a list of directories to include; if you want to include 
186-# everything that is in root, you could leave this list empty, I think.
187+# everything that is in root, you could leave this list empty (I think).
188 #INCLIST=( "/home/*/Documents" \ 
189 #    	  "/home/*/Projects" \
190 #	      "/home/*/logs" \
191@@ -98,8 +70,8 @@ EXCLIST=( "/home/*/Trash" \
192 
193 # STATIC BACKUP OPTIONS
194 # Here you can define the static backup options that you want to run with
195-# duplicity.  I use both the full-if-older-than option plus the
196-# --s3-use-new-style option (for European buckets).  Be sure to separate your
197+# duplicity.  I use both the `--full-if-older-than` option plus the
198+# `--s3-use-new-style` option (for European buckets).  Be sure to separate your
199 # options with appropriate spacing.
200 STATIC_OPTIONS="--full-if-older-than 14D --s3-use-new-style"
201 
202@@ -109,16 +81,12 @@ STATIC_OPTIONS="--full-if-older-than 14D --s3-use-new-style"
203 # backups leave room for problems in the chain, so doing a "full"
204 # backup every so often isn't not a bad idea.
205 #
206-# I set the default to do a full backup every 14 days and to remove all
207-# all files over 31 days old.  This should leave me at least two full
208-# backups available at any time, as well as a month's worth of incremental
209-# data.
210+# You can either remove older than a specific time period:
211 #CLEAN_UP_TYPE="remove-older-than"
212 #CLEAN_UP_VARIABLE="31D"
213 
214-# If you would rather keep a certain (n) number of full backups (rather 
215-# than removing the files based on their age), uncomment the following
216-# two lines and select the number of full backups you want to keep.