tweaked borg script

This commit is contained in:
2024-03-11 12:07:34 +01:00
parent 82dd8fef47
commit f7934e9ba8

View File

@@ -57,25 +57,30 @@ $ARCHIVE $SRC && if ! $LOCAL; then date +%s > $HOME/.lastbak; fi
borg prune --stats --list --keep-within 1d --glob-archives "$HOSTNAME*" \ borg prune --stats --list --keep-within 1d --glob-archives "$HOSTNAME*" \
-d 7 \ -d 7 \
-w 4 \ -w 4 \
-m 12 \ -m 6 \
-y 3 \ -y 1 \
$REPO $REPO
if $LOCAL && nmcli connection show --active | grep '^vt-net' > /dev/null if $LOCAL
then then
SRC=""
if ! nmcli connection show --active | grep '^vt-net' > /dev/null
then
SRC="--from local"
fi
echo "backing up Photo archive..." echo "backing up Photo archive..."
cd "/run/media/$USER/$DISK/photos" cd "/run/media/$USER/$DISK/photos"
git annex sync git annex sync
# set +e # set +e
# git annex mirror --from=origin # git annex mirror --from=origin
git annex get git annex get $SRC
# set -e # set -e
git annex sync git annex sync
echo "backing up Audio archive..." echo "backing up Audio archive..."
cd "/run/media/$USER/$DISK/audio" cd "/run/media/$USER/$DISK/audio"
git annex sync git annex sync
### git annex mirror --from=origin ### git annex mirror --from=origin
git annex get git annex get $SRC
git annex sync git annex sync
cd / cd /
udisksctl unmount -b "/dev/disk/by-label/$DISK" udisksctl unmount -b "/dev/disk/by-label/$DISK"