Skip to content

Commit a9fdc41

Browse files
MB-FinskitheCalcaholic
authored andcommitted
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>
1 parent 4153398 commit a9fdc41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/ncp-update-nc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ rollback() {
165165
rm -rf /var/www/nextcloud.tar.bz2 "$BASEDIR"/nextcloud-old
166166
echo "Rolling back to backup $BKP..."
167167
local TMPDATA
168-
TMPDATA="$( mktemp -d "/var/www/ncp-data.XXXXXX" )" || { echo "Failed to create temp dir" >&2; exit 1; }
168+
TMPDATA="$( mktemp -d "$BASEDIR/recovery/ncp-data.XXXXXX" )" || { echo "Failed to create temp dir" >&2; exit 1; }
169169
[[ "$DATADIR" == "$BASEDIR/nextcloud/data" ]] && mv -T "$DATADIR" "$TMPDATA"
170170
ncp-restore "$BKP" || { echo "Rollback failed! Data left at $TMPDATA"; exit 1; }
171171
[[ "$DATADIR" == "$BASEDIR/nextcloud/data" ]] && { rm -rf "$DATADIR"; mv -T "$TMPDATA" "$DATADIR"; }

0 commit comments

Comments
 (0)