From 151f2f4e8ab8fd2596a6ad5dec9303122bf7c8e7 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Wed, 15 Jan 2025 11:37:17 +0100 Subject: [PATCH] bin/bag: update for btrfs snapshots --- .local/bin/scripts/bag | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.local/bin/scripts/bag b/.local/bin/scripts/bag index f11ce2f..ff05e19 100755 --- a/.local/bin/scripts/bag +++ b/.local/bin/scripts/bag @@ -20,7 +20,8 @@ name="::$(test -n "$name" && echo "$name" || cat /etc/hostname)_${1:-system}_$(d echo "Backing up as $name" # TODO ignore electron caches ${run:-sudo --preserve-env=BORG_REPO BORG_PASSPHRASE="$($BORG_PASSCOMMAND)" borg} create --exclude-caches $args \ - $(echo $DIRS_IGNORE_SAFE -x 'software-challenge/**/build' -x state/emacs -x state/go -x .local/lib -x .cpan -x *cache -x $HOME/.gem | + $(echo $DIRS_IGNORE_SAFE -x .snapshots -x 'software-challenge/**/build' -x state/emacs -x state/go -x .local/lib -x .cpan -x *cache -x $HOME/.gem | sed 's|-x \([^ ]\+\)|-e sh:**/\1|g') \ - "$name" $(test $# -eq 0 && echo etc home root || test $# -eq 1 && echo $1) "${@:2}" 2>&1 + "$name" $(test $# -eq 0 && echo etc $HOME root || test $# -eq 1 && echo $1) "${@:2}" 2>&1 test -n "$run" || sudo chown -R $USER:$USER "$BORG_REPO" +$(cat /tmp/after-borg || true)