diff --git a/CHANGELOG b/CHANGELOG index 54c388e..b1ea7c4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,38 +1,41 @@ -Version Four (marionline) - * Add --list-files to view in the standart-output files stored in my archive - * Modification on --restore: if I provide a path to --restore option I don't want to answare a confermation question too - -Version Four (0.4) +0.4 Version Four (03/13/10) +=========================== * Moved the source code to github - * Added command line --restore to path (rather than script specific) - * Added --restore-file option + * Add --list-files to view in the standart-output files stored in my archive [mariononline] + * Added ECHO command to troublshoot the code when needed + * Added command line --restore to path & removed RESTORE variable [mariononline] + * Added --restore-file option [mariononline] * Changed --backup-this-script to --backup-scrip * Added README to --backup-script * Force use of --backup option (no accidently running the script) + * Added help text to the command line script itself [mariononline] * Script without options shows --help and current directory settings - * Removed the RESTORE variable from the script (command line now) - * Removed --test option (can't remember what it is for) + * Script checks to make sure you have put some variables in before it runs [mariononline] + * A number of other minor changes Version Three (01/31/09) +======================== - 1. Added comment to explain why folks need to use s3+ and not s3: for Amazon buckets - 2. Used "unset" to remove the variables at end of the script - 3. Fixed a problem when the backup folder on S3 was nested inside another bucket - 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. - 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. - 6. Cleaned up the get_file_size function so it wouldn't run when it wasn't supposed to. + * Added comment to explain why folks need to use 's3+' and not 's3:' for Amazon buckets + * Used "unset" to remove the variables at end of the script + * Fixed a problem when the backup folder on S3 was nested inside another bucket + * 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. + * 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. + * Cleaned up the get_file_size function so it wouldn't run when it wasn't supposed to. Version Two (12/03/08) +====================== - 1. added GPL license - 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 - 3. added option to force cleanup after (n) number of full backups (rather than by days) - 4. option to changed log file ownership - 5. runtime checks for installed required software and write permissions on log directory - 6. fixed formatting of logfile to be a little more consistent - 7. setup everything in clever functions + * added GPL license + * 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 + * added option to force cleanup after (n) number of full backups (rather than by days) + * option to changed log file ownership + * runtime checks for installed required software and write permissions on log directory + * fixed formatting of logfile to be a little more consistent + * setup everything in clever functions Version One (11/24/08) +====================== - 1. Initial release. +* Initial release. diff --git a/README b/README index e6ef682..83ec4bb 100644 --- a/README +++ b/README @@ -20,14 +20,23 @@ http://github.com/thornomad/dt-s3-backup BEFORE YOU START ================ -This is a bash script that requires user configuration. Instructions are in +This script requires user configuration. Instructions are in the file itself and should be self-explanatory. Be sure to replace all the *foobar* values with your real ones. Almost every value needs to be -configured. +configured in someway. -After the script is configured, you can move it to /usr/local/sbin/ or wherever -you please and run it from there. A cron job is always nice. Be sure to make -the script executable (chmod +x) before you hit the gas. +You can use multiple copies of the script with different settings for different +backup scenarios. It is designed to run as a cron job and will log information +to a text file (including remote file sizes, if you have s3cmd installed). Be +sure to make the script executable (chmod +x) before you hit the gas. + +REQUIREMENTS +============ + +* duplicity +* gpg +* Amazon S3 +* s3cmd (optional) COMMON USAGE EXAMPLES ===================== @@ -38,6 +47,9 @@ COMMON USAGE EXAMPLES * Run an incremental backup: $ dt-s3-backup.sh --backup +* Force a one-off full backup: + $ dt-s3-backup.sh --full + * Restore your entire backup: $ dt-s3-backup.sh --restore You will be prompted for a restore directory @@ -61,6 +73,8 @@ COMMON USAGE EXAMPLES * Verify the backup $ dt-s3-backup.sh --verify +* Backup the script and gpg key (for safekeeping) + $ dt-s3-backup.sh --backup-script NEXT VERSION WISH LIST ====================== diff --git a/dt-s3-backup.sh b/dt-s3-backup.sh index 5916006..a1a669a 100755 --- a/dt-s3-backup.sh +++ b/dt-s3-backup.sh @@ -100,8 +100,13 @@ LOG_FILE="duplicity-`date +%Y-%m-%d-%M`.txt" LOG_FILE_OWNER="foobar_user_name:foobar_user_name" VERBOSITY="-v3" -# END OF USER EDITS - +# TROUBLESHOOTING: If you are having any problems running this script it is +# helpful to see the command output that is being generated to determine if the +# script is causing a problem or if it is an issue with duplicity (or your +# setup). Simply uncomment the ECHO line below and the commands will be +# printed to the logfile. This way, you can see if the problem is with the +# script or with duplicity. +#ECHO=$(which echo) ############################################################## # Script Happens Below This Line - Shouldn't Require Editing # @@ -198,7 +203,7 @@ include_exclude() duplicity_cleanup() { echo "-----------[ Duplicity Cleanup ]-----------" >> ${LOGFILE} - ${DUPLICITY} ${CLEAN_UP_TYPE} ${CLEAN_UP_VARIABLE} --force \ + ${ECHO} ${DUPLICITY} ${CLEAN_UP_TYPE} ${CLEAN_UP_VARIABLE} --force \ --encrypt-key=${GPG_KEY} \ --sign-key=${GPG_KEY} \ ${DEST} >> ${LOGFILE} @@ -207,7 +212,7 @@ duplicity_cleanup() duplicity_backup() { - ${DUPLICITY} ${OPTION} ${VERBOSITY} ${STATIC_OPTIONS} \ + ${ECHO} ${DUPLICITY} ${OPTION} ${VERBOSITY} ${STATIC_OPTIONS} \ --encrypt-key=${GPG_KEY} \ --sign-key=${GPG_KEY} \ ${EXCLUDE} \ @@ -414,9 +419,12 @@ fi echo -e "-------- END DT-S3-BACKUP SCRIPT --------\n" >> ${LOGFILE} +if [ ${ECHO} ]; then + echo "TEST RUN ONLY: Check the logfile for command output." +fi + unset AWS_ACCESS_KEY_ID unset AWS_SECRET_ACCESS_KEY unset PASSPHRASE # vim: set tabstop=2 shiftwidth=2 sts=2 autoindent smartindent: -# EOF