From a9fdc4141d8226498a97886721a8c4cc0da55be5 Mon Sep 17 00:00:00 2001 From: MB-Finski <64466176+MB-Finski@users.noreply.github.com> Date: Sun, 2 Oct 2022 22:09:38 +0300 Subject: [PATCH] Change backup directory for docker compatibility Improve docker compatibility: Change the backup directory for ./nextcloud/data to reside within the host file system (basedir) so as to avoid moving the data folder back and forth between the docker container and the host file system. In situations where the nextcloud data takes up more than the free available space on the host system, this may lead to loosing some or all of the data. Signed-off-by: MB-Finski <64466176+MB-Finski@users.noreply.github.com> --- bin/ncp-update-nc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ncp-update-nc b/bin/ncp-update-nc index 28fa51825..7d1930276 100755 --- a/bin/ncp-update-nc +++ b/bin/ncp-update-nc @@ -165,7 +165,7 @@ rollback() { rm -rf /var/www/nextcloud.tar.bz2 "$BASEDIR"/nextcloud-old echo "Rolling back to backup $BKP..." local TMPDATA - TMPDATA="$( mktemp -d "/var/www/ncp-data.XXXXXX" )" || { echo "Failed to create temp dir" >&2; exit 1; } + TMPDATA="$( mktemp -d "$BASEDIR/recovery/ncp-data.XXXXXX" )" || { echo "Failed to create temp dir" >&2; exit 1; } [[ "$DATADIR" == "$BASEDIR/nextcloud/data" ]] && mv -T "$DATADIR" "$TMPDATA" ncp-restore "$BKP" || { echo "Rollback failed! Data left at $TMPDATA"; exit 1; } [[ "$DATADIR" == "$BASEDIR/nextcloud/data" ]] && { rm -rf "$DATADIR"; mv -T "$TMPDATA" "$DATADIR"; }