From 25ad989fb72a53556421bd6e56c2275be9eadcab Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 24 Sep 2011 19:09:14 +0200 Subject: Make the .dup generated by ninjahelper more consistent with example.dup. I.e. document tmpdir. --- handlers/dup.helper.in | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'handlers/dup.helper.in') diff --git a/handlers/dup.helper.in b/handlers/dup.helper.in index 7f82c2f..050cbca 100644 --- a/handlers/dup.helper.in +++ b/handlers/dup.helper.in @@ -286,6 +286,12 @@ nicelevel = $dup_nicelevel # if 'desturl' is set below, 'testconnect' must be set to 'no' for now. testconnect = $dup_testconnect +## temporary directory used by duplicity, set to some other location if your /tmp is small +## default is either /tmp or /usr/tmp, depending on the system +## +## Default: +# tmpdir = /tmp + ###################################################### ## gpg section ## (how to encrypt and optionally sign the backups) -- cgit v1.2.3 From f351306d82a5a98f1827643deefc7ed69ce98716 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 22 Oct 2011 21:46:50 +0200 Subject: dup: add support for RackSpace's CloudFiles. Thanks to Yuval Kogman for the patch. --- AUTHORS | 1 + ChangeLog | 2 ++ examples/example.dup | 10 ++++++++++ handlers/dup.helper.in | 10 ++++++++++ handlers/dup.in | 16 ++++++++++++++++ 5 files changed, 39 insertions(+) (limited to 'handlers/dup.helper.in') diff --git a/AUTHORS b/AUTHORS index a4a5fa5..2393c1a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -41,3 +41,4 @@ Sergio Talens-Oliag -- pipefail fixes Bruno Bigras -- enable tar handler in the build system aihtdikh -- Allow 'when = XXX' with spaces in .sh files. Chris Lamb -- rdiff.helper bugfix +Yuval Kogman -- RackSpace's CloudFiles support for duplicity diff --git a/ChangeLog b/ChangeLog index 0c763f1..dd7418a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ version 1.0 -- UNRELEASED dup: . Make the .dup generated by ninjahelper more consistent with example.dup. + . Add support for RackSpace's CloudFiles. + Thanks to Yuval Kogman for the patch. version 0.9.10 -- September 23, 2011 backupninja changes diff --git a/examples/example.dup b/examples/example.dup index 5e6b424..77bda83 100644 --- a/examples/example.dup +++ b/examples/example.dup @@ -194,6 +194,16 @@ exclude = /var/cache/backupninja/duplicity # awsaccesskeyid = # awssecretaccesskey = +## RackSpace's CloudFiles username, API key, and authentication URL. +## cfusername = YOUR_CF_USERNAME +## cfapikey = YOUR_CF_API_KEY +## cfauthurl = YOUR_CF_AUTH_URL +## +## Default: +# cfusername = +# cfapikey = +# cfauthurl = + ## FTP password, needed for backups using desturl = ftp://... ## ## Default: diff --git a/handlers/dup.helper.in b/handlers/dup.helper.in index 050cbca..ba2850f 100644 --- a/handlers/dup.helper.in +++ b/handlers/dup.helper.in @@ -454,6 +454,16 @@ keepincroffulls = $dup_keepincroffulls #awsaccesskeyid = YOUR_AWS_ACCESS_KEY_ID #awssecretaccesskey = YOUR_AWS_SECRET_KEY +## RackSpace's CloudFiles username, API key, and authentication URL. +## cfusername = YOUR_CF_USERNAME +## cfapikey = YOUR_CF_API_KEY +## cfauthurl = YOUR_CF_AUTH_URL +## +## Default: +# cfusername = +# cfapikey = +# cfauthurl = + # FTP password, needed for backups using desturl = ftp://... #ftp_password = diff --git a/handlers/dup.in b/handlers/dup.in index 40f6723..a3684c8 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -30,6 +30,9 @@ getconf keepincroffulls all getconf desturl getconf awsaccesskeyid getconf awssecretaccesskey +getconf cfusername +getconf cfapikey +getconf cfauthurl getconf ftp_password getconf sshoptions getconf bandwidthlimit 0 @@ -46,6 +49,9 @@ destdir=${destdir%/} 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 +if [ "`echo $desturl | @AWK@ -F ':' '{print $1}'`" == "cf+http" ]; then + [ -n "$cfusername" -a -n "$cfapikey" ] || fatal "Cloudfiles access keys must be set for S3 backups." +fi if [ "`echo $desturl | @AWK@ -F ':' '{print $1}'`" == "ftp" ]; then [ -n "$ftp_password" ] || fatal "ftp_password must be set for FTP backups." fi @@ -232,6 +238,16 @@ if [ "`echo $desturl | @AWK@ -F ':' '{print $1}'`" == "s3+http" ]; then export AWS_SECRET_ACCESS_KEY="$awssecretaccesskey" fi +### If desturl is a RackSpace's CloudFiles URL export the relevant +### environment variables +if [ "`echo $desturl | @AWK@ -F ':' '{print $1}'`" == "cf+http" ]; then + export CLOUDFILES_USERNAME="$cfusername" + export CLOUDFILES_APIKEY="$cfapikey" + if [ -n "$cfauthurl" ]; then + export CLOUDFILES_AUTHURL="$cfauthurl" + fi +fi + ### Cleanup commands (duplicity >= 0.4.4) # cleanup -- cgit v1.2.3 From 357a17b155f769f0bf290f3a11e2d84aa4350a60 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sun, 29 Jan 2012 14:39:39 +0100 Subject: Use --ssh-options with dup >= 0.6.17. ... and warn about unsupported options. --- examples/example.dup | 6 ++++++ handlers/dup.helper.in | 19 ++++++++++++++----- handlers/dup.in | 22 ++++++++++++++++------ 3 files changed, 36 insertions(+), 11 deletions(-) (limited to 'handlers/dup.helper.in') diff --git a/examples/example.dup b/examples/example.dup index 77bda83..55ac565 100644 --- a/examples/example.dup +++ b/examples/example.dup @@ -217,12 +217,18 @@ exclude = /var/cache/backupninja/duplicity ## Default: # bandwidthlimit = 0 +## duplicity < 0.6.17 +## ------------------ ## passed directly to ssh, scp (and sftp in duplicity >=0.4.2) ## warning: sftp does not support all scp options, especially -i; as ## a workaround, you can use "-o " ## an example setting would be: ## sshoptions = -o IdentityFile=/root/.ssh/id_rsa_duplicity ## +## duplicity >= 0.6.17 +## ------------------ +## supports only "-o IdentityFile=..." +## ## Default: # sshoptions = diff --git a/handlers/dup.helper.in b/handlers/dup.helper.in index ba2850f..ea794c9 100644 --- a/handlers/dup.helper.in +++ b/handlers/dup.helper.in @@ -473,11 +473,20 @@ keepincroffulls = $dup_keepincroffulls #bandwidthlimit = 128 bandwidthlimit = $dup_bandwidth -# passed directly to ssh, scp (and sftp in duplicity >=0.4.2) -# warning: sftp does not support all scp options, especially -i; as -# a workaround, you can use "-o " -#sshoptions = -o IdentityFile=/root/.ssh/id_rsa_duplicity -sshoptions = $dup_sshoptions +## duplicity < 0.6.17 +## ------------------ +## passed directly to ssh, scp (and sftp in duplicity >=0.4.2) +## warning: sftp does not support all scp options, especially -i; as +## a workaround, you can use "-o " +## an example setting would be: +## sshoptions = -o IdentityFile=/root/.ssh/id_rsa_duplicity +## +## duplicity >= 0.6.17 +## ------------------ +## supports only "-o IdentityFile=..." +## +## Default: +# sshoptions = # put the backups under this destination directory # if using 'desturl' above, this must not be set diff --git a/handlers/dup.in b/handlers/dup.in index a3684c8..b358406 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -114,13 +114,23 @@ duplicity_minor="`echo $duplicity_version | @AWK@ -F '.' '{print $2}'`" duplicity_sub="`echo $duplicity_version | @AWK@ -F '.' '{print $3}'`" ### ssh/scp/sftp options (duplicity < 0.4.3 is unsupported) -scpoptions="$sshoptions" -if [ "$bandwidthlimit" != 0 ]; then - [ -z "$desturl" ] || warning 'The bandwidthlimit option is not used when desturl is set.' - scpoptions="$scpoptions -l $bandwidthlimit" +## duplicity >= 0.6.17 : paramiko backend +if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 6 -a "$duplicity_sub" -ge 17 ]; then + if [ -n "$sshoptions" ]; then + echo "$sshoptions" | grep -Eqs '^-o[[:space:]]*IdentityFile=[^ ]+$' \ + || warning 'duplicity >= 0.6.17 only supports the IdentityFile SSH option' + fi + execstr_options="${execstr_options} --ssh-options '$sshoptions'" +## duplicity < 0.6.17 : scp/sftp backend +else + scpoptions="$sshoptions" + if [ "$bandwidthlimit" != 0 ]; then + [ -z "$desturl" ] || warning 'The bandwidthlimit option is not used when desturl is set.' + scpoptions="$scpoptions -l $bandwidthlimit" + fi + sftpoptions="$sshoptions" + execstr_options="${execstr_options} --scp-command 'scp $scpoptions' --sftp-command 'sftp $sftpoptions'" fi -sftpoptions="$sshoptions" -execstr_options="${execstr_options} --scp-command 'scp $scpoptions' --sftp-command 'sftp $sftpoptions'" ### Symmetric or asymmetric (public/private key pair) encryption if [ -n "$encryptkey" ]; then -- cgit v1.2.3