Renaming the script + update of README and CHANGELOG

This commit is contained in:
Zertrin 2012-05-05 00:20:55 +02:00
parent 32a241c2a6
commit 53034bcfd8
4 changed files with 81 additions and 56 deletions

View file

@ -1,3 +1,4 @@
Damon Timm <damontimm@gmail.com> <http://blog.damontimm.com>
Mario Santagiuliana <mario@marionline.it> <http://www.marionline.it>
Razvan Marescu <rmarescu+github@gmail.com> <http://github.com/rmarescu>
Marc Gallet <gmarc34@gmail.com> <http://github.com/zertrin>

View file

@ -1,3 +1,18 @@
0.6 Version Six (4 May 2012)
============================
This is a rework of the script to include some github patches that were brought to the original script in order to make the script more generic than only Amazon S3 oriented and fix a few issues.
* Added ability not to encrypt the backup [orkaa]
* Added ability to use backup destination locations other than Amazon S3 [orkaa]
* Added support for collection-status function [orkaa]
* Added ability to specify variables in a config file [poppen]
* Fixed broken european S3 buckets [thornomad]
* Fixed sed issue [poppen]
* Fixed incorrect handling of spaces un paths and filenames [hexwizard]
* Renamed script to 'duplicity-backup'
* Modified README file to reflect the renaming of the script
* Cleaned up tabs in source file
0.5 Version Five (05/09/11)
===========================
@ -12,7 +27,7 @@
* Added ECHO command to troublshoot the code when needed
* Added command line --restore to path & removed RESTORE variable [marionline]
* Added --restore-file option [marionline]
* Changed --backup-this-script to --backup-scrip
* Changed --backup-this-script to --backup-script
* Added README to --backup-script
* Force use of --backup option (no accidently running the script)
* Added help text to the command line script itself [marionline]
@ -44,4 +59,4 @@ Version Two (12/03/08)
Version One (11/24/08)
======================
* Initial release.
* Initial release.

51
README
View file

@ -2,10 +2,10 @@ ABOUT THIS SCRIPT
=================
This bash script was designed to automate and simplify the remote backup
process of duplicity on Amazon S3. After your script is configured, you can
easily backup, restore, verify and clean (either via cron or manually) your
data without having to remember lots of different command options and
passphrases.
process of duplicity on Amazon S3 primarily. Other backup destinations are
possible. After your script is configured, you can easily backup, restore,
verify and clean (either via cron or manually) your data without having to
remember lots of different command options and passphrases.
Most importantly, you can easily backup the script and your gpg key in a
convenient passphrase-encrypted file. This comes in in handy if/when your
@ -14,11 +14,20 @@ machine ever does go belly up.
Optionally, you can set up an email address where the log file will be sent,
which is useful when the script is used via cron.
More information about this script avaiable at:
http://damontimm.com/code/dt-s3-backup
This version is a rewriting of the original code by Marc Gallet, including many
of the patches that have been brought to the original scripts by various forks
on Github.
Latest version of the code is available at:
http://github.com/thornomad/dt-s3-backup
Latest version of the code available at:
http://github.com/zertrin/duplicity-backup
Merge requests are welcome :)
More information about this script available at:
http://zertrin.org/duplicity-backup.html
The original version of the code availabe at:
http://github.com/theterran/dt-s3-backup
BEFORE YOU START
================
@ -38,7 +47,7 @@ REQUIREMENTS
* duplicity
* gpg
* Amazon S3
* Amazon S3 (optional)
* s3cmd (optional)
* mailx (optional)
@ -46,39 +55,39 @@ COMMON USAGE EXAMPLES
=====================
* View help:
$ dt-s3-backup.sh
$ duplicity-backup.sh
* Run an incremental backup:
$ dt-s3-backup.sh --backup
$ duplicity-backup.sh --backup
* Force a one-off full backup:
$ dt-s3-backup.sh --full
$ duplicity-backup.sh --full
* Restore your entire backup:
$ dt-s3-backup.sh --restore
$ duplicity-backup.sh --restore
You will be prompted for a restore directory
$ dt-s3-backup.sh --restore /home/user/restore-folder
$ duplicity-backup.sh --restore /home/user/restore-folder
You can also provide a restore folder on the command line.
* Restore a specific file in the backup:
$ dt-s3-backup.sh --restore-file
$ duplicity-backup.sh --restore-file
You will be prompted for a file to restore to the current directory
$ dt-s3-backup.sh --restore-file img/mom.jpg
$ duplicity-backup.sh --restore-file img/mom.jpg
Restores the file img/mom.jpg to the current directory
$ dt-s3-backup.sh --restore-file img/mom.jpg /home/user/i-love-mom.jpg
$ duplicity-backup.sh --restore-file img/mom.jpg /home/user/i-love-mom.jpg
Restores the file img/mom.jpg to /home/user/i-love-mom.jpg
* List files in the remote archive
$ dt-s3-backup.sh --list-current-files
$ duplicity-backup.sh --list-current-files
* Verify the backup
$ dt-s3-backup.sh --verify
$ duplicity-backup.sh --verify
* Backup the script and gpg key (for safekeeping)
$ dt-s3-backup.sh --backup-script
$ duplicity-backup.sh --backup-script
TROUBLESHOOTING
===============
@ -88,7 +97,7 @@ are having any problems with the script the first step is to determine if the
script is generating an incorrect command or if duplicity itself is
causing your error.
To see exactly what is happening when you run dt-s3-backup, head to the bottom
To see exactly what is happening when you run duplicity-backup, head to the bottom
of the user configuration portion of the script and uncomment the `ECHO=$(which
echo)` variable. This will stop the script from running and will, instead,
output the generated command into your log file. You can then check to see if

View file

@ -125,7 +125,7 @@ VERBOSITY="-v3"
# address is provided, no alert will be sent.
# You can set a custom from email address and a custom subject (both optionally)
# If no value is provided for the subject, the following value will be
# used by default: "DT-S3 Alert ${LOG_FILE}"
# used by default: "duplicity-backup Alert ${LOG_FILE}"
# MTA used: mailx
#EMAIL="admin@example.com"
EMAIL_TO=
@ -187,7 +187,7 @@ size information unavailable."
NO_S3CMD_CFG="WARNING: s3cmd is not configured, run 's3cmd --configure' \
in order to retrieve remote file size information. Remote file \
size information unavailable."
README_TXT="In case you've long forgotten, this is a backup script that you used to backup some files (most likely remotely at Amazon S3). In order to restore these files, you first need to import your GPG private key (if you haven't already). The key is in this directory and the following command should do the trick:\n\ngpg --allow-secret-key-import --import dt-s3-backup-secret.key.txt\n\nAfter your key as been succesfully imported, you should be able to restore your files.\n\nGood luck!"
README_TXT="In case you've long forgotten, this is a backup script that you used to backup some files (most likely remotely at Amazon S3). In order to restore these files, you first need to import your GPG private key (if you haven't already). The key is in this directory and the following command should do the trick:\n\ngpg --allow-secret-key-import --import duplicity-backup-secret.key.txt\n\nAfter your key as been succesfully imported, you should be able to restore your files.\n\nGood luck!"
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."
if [ ! -x "$DUPLICITY" ]; then
@ -331,7 +331,7 @@ backup_this_script()
else
SCRIPTPATH=$(which ${0})
fi
TMPDIR=dt-s3-backup-`date +%Y-%m-%d`
TMPDIR=duplicity-backup-`date +%Y-%m-%d`
TMPFILENAME=${TMPDIR}.tar.gpg
README=${TMPDIR}/README
@ -349,7 +349,7 @@ backup_this_script()
mkdir -p ${TMPDIR}
cp $SCRIPTPATH ${TMPDIR}/
gpg -a --export-secret-keys ${GPG_KEY} > ${TMPDIR}/dt-s3-backup-secret.key.txt
gpg -a --export-secret-keys ${GPG_KEY} > ${TMPDIR}/duplicity-backup-secret.key.txt
echo -e ${README_TXT} > ${README}
echo "Encrypting tarball, choose a password you'll remember..."
tar c ${TMPDIR} | gpg -aco ${TMPFILENAME}
@ -373,7 +373,7 @@ check_variables ()
fi
}
echo -e "-------- START dt-s3-backup SCRIPT --------\n" >> ${LOGFILE}
echo -e "-------- START duplicity-backup SCRIPT --------\n" >> ${LOGFILE}
case "$1" in
"--backup-script")
@ -528,14 +528,14 @@ case "$1" in
;;
esac
echo -e "-------- END dt-s3-backup SCRIPT --------\n" >> ${LOGFILE}
echo -e "-------- END duplicity-backup SCRIPT --------\n" >> ${LOGFILE}
if [ $EMAIL_TO ]; then
if [ ! -x "$MAIL" ]; then
echo -e "Email couldn't be sent. mailx not available." >> ${LOGFILE}
else
EMAIL_FROM=${EMAIL_FROM:+"-r ${EMAIL_FROM}"}
EMAIL_SUBJECT=${EMAIL_SUBJECT:="DT-S3 Alert ${LOG_FILE}"}
EMAIL_SUBJECT=${EMAIL_SUBJECT:="duplicity-backup Alert ${LOG_FILE}"}
cat ${LOGFILE} | ${MAIL} -s """${EMAIL_SUBJECT}""" $EMAIL_FROM ${EMAIL_TO}
echo -e "Email alert sent to ${EMAIL_TO} using ${MAIL}" >> ${LOGFILE}
fi