diff options
author | Florian Pritz <bluewind@xinu.at> | 2016-04-16 11:10:32 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2016-04-16 11:10:32 +0200 |
commit | a941d5f8b45d01dd8e784a380d8ad52a658e748d (patch) | |
tree | 663e3596ee1a4c72ebb38294f01e7f2206088879 | |
parent | fd59bb1d5ee46d5275826376112c7371ecf49d3d (diff) | |
download | bin-a941d5f8b45d01dd8e784a380d8ad52a658e748d.tar.gz bin-a941d5f8b45d01dd8e784a380d8ad52a658e748d.tar.xz |
backup.sh: disable --progress for cronjobs; add comment
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-x | backup.sh | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -21,7 +21,8 @@ main() { TMPDIR="$(mktemp -d "/tmp/${0##*/}.XXXXXX")" trap "rm -rf '${TMPDIR}'" EXIT TERM - # these mountpoints will be excluded + # these mountpoints will be excluded. mountpoints not listed in either this + # or the includeMountpoints variable below will throw an error excludeMountpoints=( /tmp /sys @@ -74,16 +75,19 @@ EOF backup_borg() { local src=$1 local dst=$2 + local -a options=( + --verbose + --numeric-owner + --compression lz4 + --stats + --exclude-from "$TMPDIR/exclude-list-borg" + ) + + if tty -s; then + options+=(--progress) + fi - borg create \ - -v \ - --numeric-owner \ - --compression lz4 \ - --stats \ - --progress \ - --exclude-from "$TMPDIR/exclude-list-borg" \ - "$dst::backup-$(date "+%Y%m%d-%H%M%S")" "$src" - + borg create "${options[@]}" "$dst::backup-$(date "+%Y%m%d-%H%M%S")" "$src" borg prune -v --keep-within 6m "$dst" } |