From 99434c8b07f29fd45d1db55b30b5820a47d5a1ab Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 6 May 2010 20:05:20 +0200 Subject: Added ftp_password option. This is the only way to securely transmit the FTP password from backupninja to duplicity. --- handlers/dup.in | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'handlers/dup.in') diff --git a/handlers/dup.in b/handlers/dup.in index b881b0a..4e0bbcf 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -29,6 +29,7 @@ getconf keep 60 getconf desturl getconf awsaccesskeyid getconf awssecretaccesskey +getconf ftp_password getconf sshoptions getconf bandwidthlimit 0 getconf desthost @@ -44,6 +45,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}'`" == "ftp" ]; then + [ -n "$ftp_password" ] || fatal "ftp_password must be set for FTP backups." +fi ### VServers # If vservers are configured, check that the ones listed in $vsnames do exist. @@ -269,6 +273,7 @@ if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 4 -a "$duplicity_sub" -g debug "$precmd duplicity cleanup --force $execstr_options $execstr_serverpart" if [ ! $test ]; then export PASSPHRASE=$password + export FTP_PASSWORD=$ftp_password output=`nice -n $nicelevel \ su -c \ "$precmd duplicity cleanup --force $execstr_options $execstr_serverpart 2>&1"` @@ -289,6 +294,7 @@ if [ "$keep" != "yes" ]; then debug "$precmd duplicity remove-older-than $keep --force $execstr_options $execstr_serverpart" if [ ! $test ]; then export PASSPHRASE=$password + export FTP_PASSWORD=$ftp_password output=`nice -n $nicelevel \ su -c \ "$precmd duplicity remove-older-than $keep --force $execstr_options $execstr_serverpart 2>&1"` @@ -309,6 +315,7 @@ debug "$precmd duplicity $execstr_command $execstr_options $execstr_source --exc if [ ! $test ]; then outputfile=`maketemp backupout` export PASSPHRASE=$password + export FTP_PASSWORD=$ftp_password output=`nice -n $nicelevel \ su -c \ "$precmd duplicity $execstr_command $execstr_options $execstr_source --exclude '**' / $execstr_serverpart >$outputfile 2>&1"` -- cgit v1.2.3