aboutsummaryrefslogtreecommitdiff
path: root/handlers/dup.in
diff options
context:
space:
mode:
Diffstat (limited to 'handlers/dup.in')
-rw-r--r--handlers/dup.in16
1 files changed, 16 insertions, 0 deletions
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