diff options
author | Erich Eckner <git@eckner.net> | 2024-04-29 18:21:50 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2024-04-29 18:21:50 +0200 |
commit | 86c82d54457b2c0c348253873c5621f145d27339 (patch) | |
tree | d2d2db114347a86899e11fed1f46720f42dd82ef | |
parent | 81cbc0739397fee392468ce4fe7b68409f7fd0d4 (diff) | |
download | hardlinkedBackups-86c82d54457b2c0c348253873c5621f145d27339.tar.xz |
accept bwlimit
-rw-r--r-- | backup.conf | 5 | ||||
-rwxr-xr-x | hardlinked-backup.in | 5 |
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 |