diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | backup.conf | 5 | ||||
-rwxr-xr-x | hardlinked-backup.in | 5 | ||||
-rwxr-xr-x | remove-old-backups.in | 2 |
4 files changed, 12 insertions, 2 deletions
@@ -26,7 +26,7 @@ BINDIR = /usr/bin LIBDIR = /usr/lib MANDIR = /usr/share/man -VERSION = 2.0.1 +VERSION = 2.1 all: man.commons \ hardlinked-backup hardlinked-backup.1 \ 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 diff --git a/remove-old-backups.in b/remove-old-backups.in index c931409..e1a795d 100755 --- a/remove-old-backups.in +++ b/remove-old-backups.in @@ -61,7 +61,7 @@ backups=$( uniq -f2 printf '%s\n' "${backups}" | \ sed "$( - for dist in $(seq 0 20 365); do + for dist in $(seq 0 20 180); do printf '/ %s \S\+$/p\n' \ "$(date '+%m %Y' -d@$(($(date +%s)-24*60*60*${dist})))" done | \ |