Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicity improvements #6

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Damon Timm <[email protected]> <http://blog.damontimm.com>
Mario Santagiuliana <[email protected]> <http://www.marionline.it>
Razvan Marescu <[email protected]> <http://github.com/rmarescu>
Marc Gallet <[email protected]> <http://github.com/zertrin>
80 changes: 52 additions & 28 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,47 +1,71 @@
0.6.1 (5 May 2012)
=================
Inclusion of two patches written by [shamer] + modified config file management.

* Added option to use ssmtp to send mail [shamer]
* Added lock file to prevent running multiple instances simultaneously [shamer]
* Modified config file management (no more specified on the command line, must be specified as an parameter at the beginning of the script)
* Fixed bad check_variables() behaviour when not using Amazon S3 storage backend without commenting AWS API keys

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)
===========================

* added ability to email log using `mailx`
* added `%H` (hour) to default logfile name
* added ability to email log using `mailx`
* added `%H` (hour) to default logfile name

0.4 Version Four (03/13/10)
===========================

* Moved the source code to github
* Add --list-files to view in the standart-output files stored in my archive [marionline]
* 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
* 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]
* Script without options shows --help and current directory settings
* Script checks to make sure you have put some variables in before it runs [marionline]
* A number of other minor changes
* Moved the source code to github
* Add --list-files to view in the standart-output files stored in my archive [marionline]
* 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-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]
* Script without options shows --help and current directory settings
* Script checks to make sure you have put some variables in before it runs [marionline]
* A number of other minor changes

Version Three (01/31/09)
========================

* 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.
* 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)
======================

* 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
* 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)
======================

* Initial release.
* Initial release.
60 changes: 39 additions & 21 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 code originally written by Damon Timm,
including many 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 is availabe at:
http://github.com/theterran/dt-s3-backup

BEFORE YOU START
================
Expand All @@ -38,47 +47,56 @@ REQUIREMENTS

* duplicity
* gpg
* Amazon S3
* Amazon S3 (optional)
* s3cmd (optional)
* mailx (optional)

CONFIGURATION
=============

The configuration takes place directly in the script and is documented there.

You can optionnaly specifiy a custom config file in the CONFIG parameter at the
very beginning. Any parameter specified in this custom config file will
override thoses specified in the script.

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
===============
Expand All @@ -88,7 +106,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
Expand Down
Loading