summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backup.conf5
-rwxr-xr-xhardlinked-backup.in5
2 files changed, 10 insertions, 0 deletions
diff --git a/backup.conf b/backup.conf
index 3d3350f..86ccd25 100644
--- a/backup.conf
+++ b/backup.conf
@@ -14,6 +14,11 @@ declare -A backups
backups['directBackup']='/path/to/destination/ user@source:path'
backups['proxiedBackup']='/path/to/destination/ user@source:path proxy_user@ssh_host'
+# bwlimits of the respective backups (consult "man rsync" for details)
+declare -A backupLimits
+
+backupLimits['slowBackup']='500k'
+
# which directories must be mounted before we can run successfully
neededMounts=('/data')
diff --git a/hardlinked-backup.in b/hardlinked-backup.in
index ab6fac0..d620e6f 100755
--- a/hardlinked-backup.in
+++ b/hardlinked-backup.in
@@ -105,6 +105,8 @@ if [ $# -eq 0 ] || [ $# -eq 1 ]; then
grep -qxF "${backupID}"; then
seldom=true
fi
+else
+ backupID=''
fi
Basis="$2"
@@ -156,6 +158,9 @@ else
fi
rsyncOptions="${rsyncOptions}${ipVer}"
+if [ -n "${backupLimits["${backupID}"]}" ]; then
+ rsyncOptions="${rsyncOptions} --bwlimit=${backupLimits["${backupID}"]}"
+fi
if [ ! -d ${Basis} ]; then
for neededMount in "${neededMounts[@]}"; do