From f7934e9ba8b1685a6e19a993acef49693d6bba8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Violet=20Truchse=C3=9F?= Date: Mon, 11 Mar 2024 12:07:34 +0100 Subject: [PATCH] tweaked borg script --- borg/backup.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/borg/backup.sh b/borg/backup.sh index e329ff4..cb2b310 100755 --- a/borg/backup.sh +++ b/borg/backup.sh @@ -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"