28c8bedfab9ced6c7a2d724088c8450191ff12bc

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

Message

Quite a few changes for 0.4 ... getting close.  View CHANGELOG I think I got them all there.

Diff

This diff is truncated to protect this page.

  1diff --git a/CHANGELOG b/CHANGELOG
  2index 5cecf5fa97ea1d9ab5c1b3e72f0c6b35e5774820..3700a2b105cc250c8a76170447f8739c955f0f2b 100644
  3--- a/CHANGELOG
  4+++ b/CHANGELOG
  5@@ -1,3 +1,15 @@
  6+Version Four (0.4)
  7+
  8+	* Moved the source code to github
  9+	* Added command line --restore to path (rather than script specific)
 10+	* Added --restore-file option
 11+	* Changed --backup-this-script to --backup-scrip
 12+	* Added README to --backup-script
 13+	* Force use of --backup option (no accidently running the script)
 14+	* Script without options shows --help and current directory settings
 15+	* Removed the RESTORE variable from the script (command line now)
 16+	* Removed --test option (can't remember what it is for)
 17+
 18 Version Three (01/31/09)
 19 
 20     1. Added comment to explain why folks need to use s3+ and not s3: for Amazon buckets
 21diff --git a/README b/README
 22index e96f16b799c253d5f0bae044c3c626d89ee9161c..faf6e7b450c3f79e56613ba40adad86167a74665 100644
 23--- a/README
 24+++ b/README
 25@@ -4,10 +4,7 @@ More information about this script avaiable at: http://damontimm.com/code/dt-s3-
 26 
 27 TO DO:
 28 
 29-* Use "--backup" as required option and have script output "--help" when run with no options
 30-* Fix "--display-config" to show the full array of include/exclude options (not just one)
 31-* Remove the RESTORE variable from the script and only take it from inputing on the command line (thereby only needing one option "--restore" and merging it with "--restore-to-path" ... this is for simplicities sake
 32 * 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
 33 * Clean up general formatting of the script and make it pretty 
 34-* Give the "foobar" values numbers (ie, "foobar-1" "foobar-2") or something so I can use a sed file to swap my own credentials in and out without any hassle -- or, maybe use a config file ... 
 35 * give demo on how to use an "--archive-dir" option
 36+* test --restore-file (specific) option
 37diff --git a/dt-s3-backup.sh b/dt-s3-backup.sh
 38old mode 100644
 39new mode 100755
 40index d79ebc84833a2e7957e3db6c48ead21f4601d046..dec6de524e601fbd3b2d537ea4228221fb88cd9b
 41--- a/dt-s3-backup.sh
 42+++ b/dt-s3-backup.sh
 43@@ -1,4 +1,5 @@
 44-#!/bin/bash
 45+#!/bin/bash  
 46+# vim: set tabstop=2 shiftwidth=2 sts=2 autoindent smartindent: 
 47 # 
 48 # Copyright (c) 2008-2010 Damon Timm.  
 49 # Copyright (c) 2010 Mario Santagiuliana.
 50@@ -44,19 +45,6 @@
 51 # set in the script itself); however, you can also run it outside of the cron
 52 # with some variables for more control.
 53 
 54-# OPTIONS:
 55-#
 56-# --full: forces a full backup (instead of waiting specified number of days)
 57-# --verify: verifies the backup (no cleanup is run) 
 58-# --restore: restores the backup to the directory specified in the script 
 59-# --restore-to-dir [path]: restores the backup to the specified path 
 60-# --restore-file [file]: restore a specific file 
 61-# --backup-this-script: let's you backup the script and secret key to the 
 62-#                       current working directory 
 63-# --test: This was a non-duplicity scripting test: check logfile  
 64-# --display-config: display directory variables configs in this script 
 65-# --help: display help
 66-
 67 # MORE INFORMATION:
 68 #
 69 # http://damontimm.com/code/dt-s3-backup
 70@@ -90,13 +78,6 @@ ROOT="/home/"
 71 DEST="file:///home/foobar_user_name/new-backup-test/"
 72 #DEST="s3+http://backup-bucket/backup-folder/"
 73 
 74-# RESTORE FOLDER
 75-# Being ready to restore is important to me, so I have this script
 76-# setup to easily be able to restore a backup by adding the 
 77-# "--restore" flag.  Indicate where you want the fili to restore to
 78-# here so you're ready to go.
 79-RESTORE="/home/foobar_user_name/restore-backup-01"
 80-
 81 # INCLUDE LIST OF DIRECTORIES
 82 # Here is a list of directories to include; if you want to include 
 83 # everything that is in root, you could leave this list empty, I think.
 84@@ -156,15 +137,6 @@ VERBOSITY="-v3"
 85 # END OF USER EDITS
 86 
 87 
 88-
 89-
 90-
 91-
 92-
 93-
 94-
 95-
 96-
 97 ##############################################################
 98 # Script Happens Below This Line - Shouldn't Require Editing # 
 99 ##############################################################
100@@ -177,6 +149,8 @@ size information unavailable."
101 NO_S3CMD_CFG="WARNING: s3cmd is not configured, run 's3cmd --configure' \
102 in order to retrieve remote file size information. Remote file \
103 size information unavailable."
104+README_TXT="This is the README file for the backup-this-script.\n\nIt needs work still."
105+CONFIG_VAR_MSG="Oops!! ${0} was unable to run!\nWe are missing one or more important variables at the top of the script.\nCheck your configuration because it appears that something has not been set yet."
106 
107 if [ ! -x "$DUPLICITY" ]; then
108   echo "ERROR: duplicity not installed, that's gotta happen first!" >&2
109@@ -221,6 +195,7 @@ get_source_file_size()
110       awk '{ print $2"\t"$1 }' \
111       >> ${LOGFILE}
112   done
113+  echo >> ${LOGFILE}
114 }
115 
116 get_remote_file_size() 
117@@ -236,6 +211,7 @@ get_remote_file_size()
118       SIZE="s3cmd not installed."
119   fi
120   echo "Current Remote Backup File Size: ${SIZE}" >> ${LOGFILE}
121+  echo >> ${LOGFILE}
122 }
123 
124 include_exclude()
125@@ -292,13 +268,14 @@ backup_this_script()
126   else
127     SCRIPTPATH=$(which ${0})
128   fi
129-  TMPDIR=DT-S3-Backup-`date +%Y-%m-%d`
130+  TMPDIR=dt-s3-backup-`date +%Y-%m-%d`
131   TMPFILENAME=${TMPDIR}.tar.gpg
132+  README=${TMPDIR}/README
133   
134   echo "You are backing up: "
135   echo "      1. ${SCRIPTPATH}"
136-  echo "      2. GPG Secret Key: $GPG_KEY"
137-  echo "Backup will be saved: `pwd`/${TMPFILENAME}"
138+  echo "      2. GPG Secret Key: ${GPG_KEY}"
139+  echo "Backup will be saved to: `pwd`/${TMPFILENAME}"
140   echo
141   echo ">> Are you sure you want to do that ('yes' to continue)?"
142   read ANSWER