update_nextcloud.sh: use realpath for data dirctory.

This commit is contained in:
Christoph 2025-06-20 22:05:33 +02:00
parent b6fd1ab6a3
commit 793b1b1e1c

View File

@ -407,14 +407,10 @@ source ${snippet_dir}/get-path-of-php-command.sh
INSTALL_DIR="${WEB_BASE_DIR}/nextcloud-${VERSION}"
CURRENT_INSTALL_DIR="$(realpath ${WEB_BASE_DIR}/nextcloud)"
#PRIOR_VERSION="$(basename $CURRENT_INSTALL_DIR | cut -d"-" -f2)"
PRIOR_VERSION="$(sudo -u $HTTP_USER ${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ --version | cut -d' ' -f2)"
#DATA_DIR=${WEB_BASE_DIR}/data-${VERSION}
#CURRENT_DATA_DIR="$(realpath ${WEB_BASE_DIR}/data-$PRIOR_VERSION)"
DATA_DIR=${WEB_BASE_DIR}/data
OLD_DATA_DIR=${WEB_BASE_DIR}/data-${PRIOR_VERSION}
DATA_DIR="$(realpath "${WEB_BASE_DIR}/data")"
OLD_DATA_DIR="$(dirname "${DATA_DIR}")/data-${PRIOR_VERSION}.${backup_date}"
@ -858,8 +854,8 @@ fi
# - Backup Daten Verzeichnis (hardlinks - harte Dateiverweise)
# -
echononl " Copy (hardlink) data directory to '${OLD_DATA_DIR}.$backup_date'.."
cp -al "${DATA_DIR}" "${OLD_DATA_DIR}.${backup_date}" > $log_file 2>&1
echononl " Copy (hardlink) data directory to '${OLD_DATA_DIR}'.."
cp -al "${DATA_DIR}" "${OLD_DATA_DIR}" > $log_file 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else