If localhost is also borg backup host, then access repository directly (not over ssh).

This commit is contained in:
2025-07-26 23:34:23 +02:00
parent bd20e94482
commit 1b3af2ff9e
5 changed files with 25 additions and 5 deletions

View File

@ -253,7 +253,11 @@ fi
[[ -z "${BORG_FUSE_MOUNT_DIR}" ]] && BORG_FUSE_MOUNT_DIR="${DEFAULT_BORG_FUSE_MOUNT_DIR}"
BORG_URL="ssh://${SSH_USER}@${BORG_HOST}:${SSH_PORT}${BORG_REPO}"
if [[ "${BORG_HOST,,}" == "localhost" ]] ; then
BORG_URL="file://${BORG_REPO}"
else
BORG_URL="ssh://${SSH_USER}@${BORG_HOST}:${SSH_PORT}${BORG_REPO}"
fi
export BORG_PASSPHRASE
export BORG_REPO