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"