From f45803230a839de092122f6843422097deff4eaa Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 18 Jul 2009 10:45:45 +0200 Subject: dup: fixed bandwidthlimit test Thanks to Ian Beckwith for the patch. --- AUTHORS | 1 + 1 file changed, 1 insertion(+) (limited to 'AUTHORS') diff --git a/AUTHORS b/AUTHORS index dc0d2bd..c5fdf33 100644 --- a/AUTHORS +++ b/AUTHORS @@ -29,3 +29,4 @@ Adam Monsen - spec file updates Matthew Palmer -- halt loglevel feature dan@garthwaite.org -- reportspace bugfix Tuomas Jormola -- "when = manual" option +Ian Beckwith -- dup bandwidthlimit fix -- cgit v1.2.3 From 1773b7f918aabd04f8901b6e7daf363f62472e8f Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 5 Jan 2010 13:18:56 +0100 Subject: Added Olivier Berger to the AUTHORS file. --- AUTHORS | 1 + 1 file changed, 1 insertion(+) (limited to 'AUTHORS') diff --git a/AUTHORS b/AUTHORS index c5fdf33..6309a1c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -30,3 +30,4 @@ Matthew Palmer -- halt loglevel feature dan@garthwaite.org -- reportspace bugfix Tuomas Jormola -- "when = manual" option Ian Beckwith -- dup bandwidthlimit fix +Olivier Berger -- dup debug output bugfix \ No newline at end of file -- cgit v1.2.3 From 8fb9415609b3181d8522f42115508dd7a3643345 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 5 Jan 2010 13:39:32 +0100 Subject: Adding optional report of infos sent by handlers in the email (closes #563734) Cherry-picked and re-indented patch 76792c8f45afa1fdaeb81c2af77499ca0b83ce64 from Olivier Berger. Conflicts: src/backupninja.in --- AUTHORS | 2 +- ChangeLog | 2 ++ etc/backupninja.conf.in | 4 ++++ src/backupninja.in | 7 ++++++- 4 files changed, 13 insertions(+), 2 deletions(-) (limited to 'AUTHORS') diff --git a/AUTHORS b/AUTHORS index 6309a1c..89b505f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -30,4 +30,4 @@ Matthew Palmer -- halt loglevel feature dan@garthwaite.org -- reportspace bugfix Tuomas Jormola -- "when = manual" option Ian Beckwith -- dup bandwidthlimit fix -Olivier Berger -- dup debug output bugfix \ No newline at end of file +Olivier Berger -- dup debug output bugfix, reportinfo option \ No newline at end of file diff --git a/ChangeLog b/ChangeLog index b6e05d0..b71a9be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ version 0.9.7 -- UNRELEASED . add 'when = manual' option, that can be used in the global config file or in a given backup action file. Thanks Tuomas Jormola for the preliminary patch (Closes: #511299) + . new reportinfo option: when set, messages sent by handlers with + "info" are included in the report e-mail (closes #563734) lib changes easydialog: . Allow form fields input to grow up to 100 chars (Closes: #562249) diff --git a/etc/backupninja.conf.in b/etc/backupninja.conf.in index f7668a5..de1fbf3 100644 --- a/etc/backupninja.conf.in +++ b/etc/backupninja.conf.in @@ -21,6 +21,10 @@ reportemail = root # even if all modules reported success. (default = yes) reportsuccess = yes +# if set to 'yes', info messages from handlers will be +# sent into the email (default = no) +reportinfo = no + # if set to 'yes', a report email will be generated # even if there was no error. (default = yes) reportwarning = yes diff --git a/src/backupninja.in b/src/backupninja.in index a991f58..f871e0c 100755 --- a/src/backupninja.in +++ b/src/backupninja.in @@ -335,8 +335,9 @@ function process_action() { _errors=`cat $bufferfile | grep "^Error: " | wc -l` _fatals=`cat $bufferfile | grep "^Fatal: " | wc -l` _halts=`cat $bufferfile | grep "^Halt: " | wc -l` + _infos=`cat $bufferfile | grep "^Info: " | wc -l` - ret=`grep "\(^Warning: \|^Error: \|^Fatal: \|Halt: \)" $bufferfile` + ret=`grep "\(^Info: \|^Warning: \|^Error: \|^Fatal: \|Halt: \)" $bufferfile` rm $bufferfile if [ $_halts != 0 ]; then msg "*halt* -- $file" @@ -356,6 +357,9 @@ function process_action() { warning "<<<< finished action $file: WARNING" else msg "success -- $file" + if [ $_infos != 0 -a "$reportinfo" == "yes" ]; then + errormsg="$errormsg\n== infos from $file ==\n\n$ret\n" + fi info "<<<< finished action $file: SUCCESS" fi @@ -456,6 +460,7 @@ getconf reportemail getconf reporthost getconf reportspace getconf reportsuccess yes +getconf reportinfo no getconf reportuser getconf reportwarning yes getconf loglevel 3 -- cgit v1.2.3 From 64c4d190a3ab6b4fa60b10208b32f3b270a72482 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 9 Jan 2010 23:14:17 +0100 Subject: dup: support backups to Amazon S3 buckets Thanks to stefan for the patch. This fixes Redmine bug #658. --- AUTHORS | 3 ++- ChangeLog | 1 + README | 10 ++++++++++ examples/example.dup | 12 ++++++++++++ handlers/dup.helper.in | 6 ++++++ handlers/dup.in | 11 +++++++++++ 6 files changed, 42 insertions(+), 1 deletion(-) (limited to 'AUTHORS') diff --git a/AUTHORS b/AUTHORS index 89b505f..c8686eb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -30,4 +30,5 @@ Matthew Palmer -- halt loglevel feature dan@garthwaite.org -- reportspace bugfix Tuomas Jormola -- "when = manual" option Ian Beckwith -- dup bandwidthlimit fix -Olivier Berger -- dup debug output bugfix, reportinfo option \ No newline at end of file +Olivier Berger -- dup debug output bugfix, reportinfo option +stefan -- dup support for Amazon S3 buckets diff --git a/ChangeLog b/ChangeLog index 12c1436..f4009d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -59,6 +59,7 @@ version 0.9.7 -- UNRELEASED . Report duplicity output as "info" so that it can be included in report e-mail when reportinfo is on (Closes: #563734) . Fix include/exclude paths with spaces + . Support backups to Amazon S3 buckets, thanks to stefan for the patch. helper changes dup: . Do not propose to exclude /home/*/.gnupg twice anymore diff --git a/README b/README index 03d96fe..04eda2f 100644 --- a/README +++ b/README @@ -182,6 +182,16 @@ blank by hitting return. The included helper program "ninjahelper" will walk you through creating an rdiff-backup configuration, and will set up the ssh keys for you. + +Amazon Simple Storage Service (S3) +================================== + +Duplicity can store backups on Amazon S3 buckets, taking care of encryption. +Since it performs incremental backups it minimizes the number of request per +operation therefore reducing the costs. The boto Python interface to Amazon +Web Services is needed to use duplicity with S3 (Debian package: python-boto). + + INSTALLATION ============ diff --git a/examples/example.dup b/examples/example.dup index 2b59fe5..ea4d66e 100644 --- a/examples/example.dup +++ b/examples/example.dup @@ -8,6 +8,8 @@ ## passed directly to duplicity, e.g. to increase verbosity set this to: ## options = --verbosity 8 +## when using the Amazon S3 backend to create buckets in Europe: +## options = --s3-european-buckets --s3-use-new-style ## ## Default: # options = @@ -158,11 +160,21 @@ exclude = /home/*/.gnupg ## examples include: ## desturl = file:///usr/local/backup ## desturl = rsync://user@other.host//var/backup/bla +## desturl = s3+http:// ## the default value of this configuration option is not set: ## ## Default: # desturl = +## Amazon Web Services Access Key ID and Secret Access Key, needed for backups +## to S3 buckets. +## awsaccesskeyid = YOUR_AWS_ACCESS_KEY_ID +## awssecretaccesskey = YOUR_AWS_SECRET_KEY +## +## Default: +# awsaccesskeyid = +# awssecretaccesskey = + ## bandwith limit, in kbit/s ; default is 0, i.e. no limit an example ## setting would be: ## bandwidthlimit = 128 diff --git a/handlers/dup.helper.in b/handlers/dup.helper.in index 2fafb99..ae48e4c 100644 --- a/handlers/dup.helper.in +++ b/handlers/dup.helper.in @@ -403,6 +403,12 @@ keep = $dup_keep # bandwithlimit. For details, see duplicity manpage, section "URL FORMAT". #desturl = file:///usr/local/backup #desturl = rsync://user@other.host//var/backup/bla +#desturl = s3+http://your_bucket + +# Amazon Web Services Access Key ID and Secret Access Key, needed for backups +# to S3 buckets. +#awsaccesskeyid = YOUR_AWS_ACCESS_KEY_ID +#awssecretaccesskey = YOUR_AWS_SECRET_KEY # bandwith limit, in kbit/s ; default is 0, i.e. no limit #bandwidthlimit = 128 diff --git a/handlers/dup.in b/handlers/dup.in index 2f55b9c..ffae48c 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -26,6 +26,8 @@ setsection dest getconf incremental yes getconf keep 60 getconf desturl +getconf awsaccesskeyid +getconf awssecretaccesskey getconf sshoptions getconf bandwidthlimit 0 getconf desthost @@ -38,6 +40,9 @@ destdir=${destdir%/} [ -n "$desturl" -o -n "$destdir" ] || fatal "The destination directory (destdir) must be set when desturl is not used." [ -n "$include" -o -n "$vsinclude" ] || fatal "No source includes specified" [ -n "$password" ] || fatal "The password option must be set." +if [ "`echo $desturl | @AWK@ -F ':' '{print $1}'`" == "s3+http" ]; then + [ -n "$awsaccesskeyid" -a -n "$awssecretaccesskey" ] || fatal "AWS access keys must be set for S3 backups." +fi ### VServers # If vservers are configured, check that the ones listed in $vsnames do exist. @@ -227,6 +232,12 @@ set +o noglob execstr_source=${execstr_source//\\*/\\\\\\*} +### If desturl is an S3 URL export the AWS environment variables +if [ "`echo $desturl | @AWK@ -F ':' '{print $1}'`" == "s3+http" ]; then + export AWS_ACCESS_KEY_ID="$awsaccesskeyid" + export AWS_SECRET_ACCESS_KEY="$awssecretaccesskey" +fi + ### Cleanup commands (duplicity >= 0.4.4) # cleanup -- cgit v1.2.3 From 46eccf2fd0c894790405b2e3aae8dfb99f5a5d98 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 9 Jan 2010 23:25:03 +0100 Subject: rdiff: fix confusing error if rdiff-backup cannot be found on remote server. Thanks to maniacmartin for the patch on which this one is based. This closes Redmine bug #1209. --- AUTHORS | 1 + ChangeLog | 1 + handlers/rdiff.in | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'AUTHORS') diff --git a/AUTHORS b/AUTHORS index c8686eb..07d55c0 100644 --- a/AUTHORS +++ b/AUTHORS @@ -32,3 +32,4 @@ Tuomas Jormola -- "when = manual" option Ian Beckwith -- dup bandwidthlimit fix Olivier Berger -- dup debug output bugfix, reportinfo option stefan -- dup support for Amazon S3 buckets +maniacmartin -- rdiff confusing error message fix diff --git a/ChangeLog b/ChangeLog index f4009d7..b1e140b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,6 +45,7 @@ version 0.9.7 -- UNRELEASED reported as such. rdiff: . Fix include/exclude paths with spaces (Closes: #398435) + . Fix confusing error if rdiff-backup cannot be found on remote server. sys: . New luksheaders option (default=disabled) to backup the Luks header of every Luks device. diff --git a/handlers/rdiff.in b/handlers/rdiff.in index 98a53a3..60386fa 100644 --- a/handlers/rdiff.in +++ b/handlers/rdiff.in @@ -31,6 +31,7 @@ function get_version() { # given no arguments, returns the local version. # given a user and host, returns the remote version. # if user or host is missing, returns the local version. + local version if [ "$#" -lt 2 ]; then debug "$RDIFFBACKUP -V" echo `$RDIFFBACKUP -V` @@ -38,7 +39,12 @@ function get_version() { local user=$1 local host=$2 debug "ssh $sshoptions $host -l $user '$RDIFFBACKUP -V'" - echo `ssh $sshoptions $host -l $user "$RDIFFBACKUP -V | grep rdiff-backup"` + version=`ssh $sshoptions $host -l $user "$RDIFFBACKUP -V"` + if [ $? = 127 ]; then + fatal "Unable to execute rdiff-backup on remote server. It probably isn't installed" + else + echo "$version" | grep rdiff-backup + fi fi } -- cgit v1.2.3