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*" \
-d 7 \
-w 4 \
-m 12 \
-y 3 \
-m 6 \
-y 1 \
$REPO
if $LOCAL && nmcli connection show --active | grep '^vt-net' > /dev/null
if $LOCAL
then
SRC=""
if ! nmcli connection show --active | grep '^vt-net' > /dev/null
then
SRC="--from local"
fi
echo "backing up Photo archive..."
cd "/run/media/$USER/$DISK/photos"
git annex sync
# set +e
# git annex mirror --from=origin
git annex get
git annex get $SRC
# set -e
git annex sync
echo "backing up Audio archive..."
cd "/run/media/$USER/$DISK/audio"
git annex sync
### git annex mirror --from=origin
git annex get
git annex get $SRC
git annex sync
cd /
udisksctl unmount -b "/dev/disk/by-label/$DISK"