ncp-restore: Don't assume data directory inside nc directory on docker

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
Tobias K 2023-01-04 21:16:58 +01:00 committed by Tobias Knöppler
parent f8e416f6d5
commit 0c3ac35e39
No known key found for this signature in database
GPG Key ID: 3510056072886A8F

View File

@ -62,8 +62,6 @@ then
target="$NCDIR/data"
[[ -d "$target" ]] && target="$NCDIR/.data_$(date)"
mv -T "$DATA_BKP_DIR" "$target"
else
echo "Dataless backup detected - not restoring data"
fi
# update NC database password to this instance
@ -93,10 +91,9 @@ mysql -u root nextcloud < "$TMPDIR"/nextcloud-sqlbkp_*.bak || { echo "Error res
## RESTORE DATADIR
if is_docker; then
DATADIR="$(get_nc_config_value datadirectory)"
if is_docker && [[ "$DATADIR" == "/var/www/nextcloud/data" ]]; then
DATADIR=/data/nextcloud/data
else
DATADIR="$(get_nc_config_value datadirectory)"
fi
[[ "$DATADIR" == "" ]] && { echo "Error reading data directory"; exit 1; }