From 86c82d54457b2c0c348253873c5621f145d27339 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 29 Apr 2024 18:21:50 +0200 Subject: accept bwlimit --- backup.conf | 5 +++++ hardlinked-backup.in | 5 +++++ 2 files changed, 10 insertions(+) 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 -- cgit v1.2.3-70-g09d2