borg-backup-nc.sh: if Nextcloud path is a symlink add the realpath to bor backup.

This commit is contained in:
Christoph 2024-07-03 12:39:52 +02:00
parent f366e7d97b
commit 55a4ff2952

View File

@ -268,6 +268,8 @@ fi
if [[ -z "${NC_PATH}" ]] ; then if [[ -z "${NC_PATH}" ]] ; then
fatal "Nextcloud's DocumentRoot directory not found!" fatal "Nextcloud's DocumentRoot directory not found!"
if [[ -h "${NC_PATH}" ]] ; then
BORG_NC_PATH="${NC_PATH} $(realpath "${NC_PATH}")"
fi fi
if [[ -z "${BORG_HOST}" ]] ; then if [[ -z "${BORG_HOST}" ]] ; then
@ -550,7 +552,7 @@ borg create \\
\\ \\
${BORG_URL}::${backup_date} \\ ${BORG_URL}::${backup_date} \\
${NC_DB_BACKUP_DIR} \\ ${NC_DB_BACKUP_DIR} \\
${NC_PATH} \\ ${BORG_NC_PATH} \\
${NC_DATA_DIR} \\ ${NC_DATA_DIR} \\
${BORG_BACKUP_DIRS} ${BORG_BACKUP_DIRS}
EOF EOF
@ -571,7 +573,7 @@ borg create \
\ \
${BORG_URL}::${backup_date} \ ${BORG_URL}::${backup_date} \
${NC_DB_BACKUP_DIR} \ ${NC_DB_BACKUP_DIR} \
${NC_PATH} \ ${BORG_NC_PATH} \
${NC_DATA_DIR} \ ${NC_DATA_DIR} \
${BORG_BACKUP_DIRS} \ ${BORG_BACKUP_DIRS} \
> ${log_file} 2>&1 > ${log_file} 2>&1