Skip to content

Commit 880c6ff

Browse files
authored
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 <[email protected]>
1 parent c5c8730 commit 880c6ff

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)