Duplicity handler: added "bandwidthlimit" option.
authorintrigeri <intrigeri@758a04ac-41e6-0310-8a23-8373a73cc35d>
Fri, 27 May 2005 18:41:40 +0000 (18:41 +0000)
committerintrigeri <intrigeri@758a04ac-41e6-0310-8a23-8373a73cc35d>
Fri, 27 May 2005 18:41:40 +0000 (18:41 +0000)
git-svn-id: http://code.autistici.org/svn/backupninja/trunk@116 758a04ac-41e6-0310-8a23-8373a73cc35d

changelog
etc/backup.d/example.dup
handlers/dup

index 44d169aa5f5833039febbb744ca46d40d473185e..ca0179d441378b11f13255403251ce0cff0fbcf4 100644 (file)
--- a/changelog
+++ b/changelog
@@ -14,6 +14,7 @@ version 0.x -- xxxxxxxxxxxxx
                added "nicelevel" option
                added "testconnect" option
                added "sshoptions" option (will be passed to ssh/scp)
+               added "bandwidthlimit" option
        example.dup example config file for duplicity handler 
        added trac (http://trac.edgewall.com/) environment handler (thanks Charles Lepple!)
 
index b8c266174b3823c7d1710e20135798ed63763814..faea3b8b7aecee191326d65145389367755b1509 100644 (file)
@@ -75,7 +75,10 @@ exclude = /home/*/.gnupg
 #keep = 60
 #keep = yes
 
-## passed directly to ssh/scp
+# bandwith limit, in kbit/s ; default is 0, i.e. no limit
+#bandwidthlimit = 128
+
+# passed directly to ssh and scp
 sshoptions = -i /root/.ssh/id_dsa_duplicity
 
 # put the backups under this directory
index 2d759b0eee22f01155294256ce36e671ef4c1b29..55667f6af63dab9f6fc1e353e703d31deea38d25 100644 (file)
@@ -19,6 +19,7 @@ getconf exclude
 setsection dest
 getconf keep 60
 getconf sshoptions
+getconf bandwidthlimit 0
 getconf desthost
 getconf destdir
 getconf destuser
@@ -43,7 +44,10 @@ fi
 
 ### COMMAND-LINE MANGLING ###
 
-execstr="$options --no-print-statistics --scp-command 'scp $sshoptions' --ssh-command 'ssh $sshoptions' "
+scpoptions="$sshoptions"
+[ "$bandwidthlimit" == 0 ] || scpoptions="$scpoptions -l $bandwidthlimit"
+
+execstr="$options --no-print-statistics --scp-command 'scp $scpoptions' --ssh-command 'ssh $sshoptions' "
 
 if [ "$encryptkey" == "" ]; then
     [ "$sign" != "yes" ] || fatal "encryptkey option must be set when signing."