From 6b289aea1692ffc518d126b4fa3a5fa52db1af58 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 3 May 2024 15:24:10 -0300 Subject: bin/backup: Rewrite using borgy --- bin/backup | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/bin/backup b/bin/backup index e702dd8..2fc85cd 100755 --- a/bin/backup +++ b/bin/backup @@ -92,31 +92,11 @@ shift $((OPTIND - 1)) ARCHIVE_TAG="${1:-manual}" -run() { - STATUS=0 - set -x - # The contents of $VERBOSE_FLAGS doesn't involve user input: - # shellcheck disable=2086 - nicely borg create \ - $VERBOSE_FLAGS \ - --comment "$COMMENT" \ - --exclude "$XDG_CACHE_HOME" \ - --exclude ~/Downloads/ \ - --exclude ~/mnt/ \ - --stats \ - --compression lzma,9 \ - "::{hostname}-{now}-$ARCHIVE_TAG" \ - ~/ || STATUS=$? - set +x - - if [ "$STATUS" = 0 ]; then - return 0 - elif [ "$STATUS" = 1 ]; then - printf 'WARNING, but no ERROR.\n' >&2 - return 0 - else - return "$STATUS" - fi -} - -run +set -x +# The contents of $VERBOSE_FLAGS doesn't involve user input: +# shellcheck disable=2086 +borgy \ + $VERBOSE_FLAGS \ + --comment "$COMMENT" \ + "::{hostname}-{now}-$ARCHIVE_TAG" \ + ~/ -- cgit v1.2.3