aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2005-05-27 18:41:40 +0000
committerintrigeri <intrigeri@boum.org>2005-05-27 18:41:40 +0000
commitcadfdca981b3dd98c2031e2d5c6e8ed5da1ac315 (patch)
tree1ee0d0f377600b452eaa0134e80ad150d6e64e7d
parent3a6d8d25e4e525c4fd2b126475c8df1b00d4f493 (diff)
downloadbackupninja-cadfdca981b3dd98c2031e2d5c6e8ed5da1ac315.tar.gz
backupninja-cadfdca981b3dd98c2031e2d5c6e8ed5da1ac315.tar.bz2
Duplicity handler: added "bandwidthlimit" option.
-rw-r--r--changelog1
-rw-r--r--etc/backup.d/example.dup5
-rw-r--r--handlers/dup6
3 files changed, 10 insertions, 2 deletions
diff --git a/changelog b/changelog
index 44d169a..ca0179d 100644
--- 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!)
diff --git a/etc/backup.d/example.dup b/etc/backup.d/example.dup
index b8c2661..faea3b8 100644
--- a/etc/backup.d/example.dup
+++ b/etc/backup.d/example.dup
@@ -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
diff --git a/handlers/dup b/handlers/dup
index 2d759b0..55667f6 100644
--- a/handlers/dup
+++ b/handlers/dup
@@ -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."