dup: warn about bandwithlimit being unused when desturl is set
authorintrigeri <intrigeri@758a04ac-41e6-0310-8a23-8373a73cc35d>
Tue, 24 Jun 2008 14:11:22 +0000 (14:11 +0000)
committerintrigeri <intrigeri@758a04ac-41e6-0310-8a23-8373a73cc35d>
Tue, 24 Jun 2008 14:11:22 +0000 (14:11 +0000)
git-svn-id: http://code.autistici.org/svn/backupninja/trunk@569 758a04ac-41e6-0310-8a23-8373a73cc35d

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

index 91ff07e4b6a8f9bb43255bb0ab138346fbbf2dd8..830a47d6555d882489102b4976b4b27207b92412 100644 (file)
@@ -121,8 +121,8 @@ exclude = /home/*/.gnupg
 #keep = yes
 
 # full destination URL, in duplicity format; if set, desturl overrides
-# sshoptions, destdir, desthost and destuser, and disables testconnect
-# For details, see duplicity manpage, section "URL FORMAT".
+# sshoptions, destdir, desthost and destuser; it also disables testconnect and
+# bandwithlimit. For details, see duplicity manpage, section "URL FORMAT".
 #desturl = file:///usr/local/backup
 #desturl = rsync://user@other.host//var/backup/bla
 
index 96828ef739c14821b7f1612a9119d23fbe22a8d7..c1fbdd53fc76a549d20a78b38a5719b25d622e37 100644 (file)
@@ -398,8 +398,8 @@ incremental = $dup_incremental
 keep = $dup_keep
 
 # full destination URL, in duplicity format; if set, desturl overrides
-# sshoptions, destdir, desthost and destuser, and disables testconnect
-# For details, see duplicity manpage, section "URL FORMAT".
+# sshoptions, destdir, desthost and destuser; it also disables testconnect and
+# bandwithlimit. For details, see duplicity manpage, section "URL FORMAT".
 #desturl = file:///usr/local/backup
 #desturl = rsync://user@other.host//var/backup/bla
 
index cae99097e814b764cacdb20d3ebfa6acb5fa2f46..0f4e58e0a65fa466ca297a297fc68766a5583b34 100644 (file)
@@ -105,7 +105,10 @@ duplicity_sub="`echo $duplicity_version | @AWK@ -F '.' '{print $3}'`"
 #    --sftp-command ourselves
 
 scpoptions="$sshoptions"
-[ "$bandwidthlimit" == 0 ] || scpoptions="$scpoptions -l $bandwidthlimit"
+if [ "$bandwidthlimit" =! 0 ]; then
+   [ -z "$testurl" ] || warning 'The bandwidthlimit option is not used when desturl is set.'
+   scpoptions="$scpoptions -l $bandwidthlimit"
+fi
 
 # < 0.4.2 : only uses ssh and scp
 if [ "$duplicity_major" -le 0 -a "$duplicity_minor" -le 4 -a "$duplicity_sub" -lt 2 ]; then