aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-05-03 15:24:10 -0300
committerEuAndreh <eu@euandre.org>2024-05-03 15:24:10 -0300
commit6b289aea1692ffc518d126b4fa3a5fa52db1af58 (patch)
tree7cacbfde1b9e47213aa06f9f3ea94ff4c1d917cb /bin
parentbin/borgy: Wrapper on borg(1) with better defaults (diff)
downloaddotfiles-6b289aea1692ffc518d126b4fa3a5fa52db1af58.tar.gz
dotfiles-6b289aea1692ffc518d126b4fa3a5fa52db1af58.tar.xz
bin/backup: Rewrite using borgy
Diffstat (limited to 'bin')
-rwxr-xr-xbin/backup36
1 files 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" \
+ ~/