]> gitweb.fluxo.info Git - backupninja.git/commitdiff
dup: add support for RackSpace's CloudFiles.
authorintrigeri <intrigeri@boum.org>
Sat, 22 Oct 2011 19:46:50 +0000 (21:46 +0200)
committerintrigeri <intrigeri@boum.org>
Sat, 22 Oct 2011 19:46:50 +0000 (21:46 +0200)
Thanks to Yuval Kogman <nothingmuch@woobling.org> for the patch.

AUTHORS
ChangeLog
examples/example.dup
handlers/dup.helper.in
handlers/dup.in

diff --git a/AUTHORS b/AUTHORS
index a4a5fa50e6ed61d2b38b9c98697d760a5fea8049..2393c1ac0fff46ce264f2e290844eb64d66d82c0 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -41,3 +41,4 @@ Sergio Talens-Oliag <sto@debian.org> -- pipefail fixes
 Bruno Bigras <bigras.bruno@gmail.com> -- enable tar handler in the build system
 aihtdikh -- Allow 'when = XXX' with spaces in .sh files.
 Chris Lamb <lamby@debian.org> -- rdiff.helper bugfix
+Yuval Kogman <nothingmuch@woobling.org> -- RackSpace's CloudFiles support for duplicity
index 0c763f14f706a82e608c4ccedef54290580cdb9d..dd7418ae63f81a09f19d55db60523806de7e0f15 100644 (file)
--- 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 <nothingmuch@woobling.org> for the patch.
 
 version 0.9.10 -- September 23, 2011
     backupninja changes
index 5e6b424cd70246efc7e8de494c52428fedb8d00a..77bda836728a590a8d1bf0e31f53d8adeb69bf78 100644 (file)
@@ -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:
index 050cbcaa372be2373e33f6cf534d08ff2d25d036..ba2850f401f814723ca3b7167db672c3cd0cb079 100644 (file)
@@ -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 = 
 
index 40f67235d323a91c1c6e0be2093d37cfadb27170..a3684c8d712017e8cc5c8892db01e2eab0786da8 100644 (file)
@@ -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