bin/bag: update for btrfs snapshots

This commit is contained in:
xeruf 2025-01-15 11:37:17 +01:00
parent cf33fa7b79
commit 151f2f4e8a

View file

@ -20,7 +20,8 @@ name="::$(test -n "$name" && echo "$name" || cat /etc/hostname)_${1:-system}_$(d
echo "Backing up as $name" echo "Backing up as $name"
# TODO ignore electron caches # TODO ignore electron caches
${run:-sudo --preserve-env=BORG_REPO BORG_PASSPHRASE="$($BORG_PASSCOMMAND)" borg} create --exclude-caches $args \ ${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') \ 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" test -n "$run" || sudo chown -R $USER:$USER "$BORG_REPO"
$(cat /tmp/after-borg || true)