From c7219c64e2406368f5f0ab9de58bedd7c1975264 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 2 May 2021 20:33:28 -0500 Subject: [PATCH] Changed upgrade backup to be placed in /tmp to avoid build-up #150 --- bedrock-entry.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bedrock-entry.sh b/bedrock-entry.sh index b117372..557927b 100755 --- a/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -85,7 +85,7 @@ if [ ! -f "bedrock_server-${VERSION}" ]; then # remove only binaries and some docs, to allow for an upgrade of those rm -rf bedrock_server *.so release-notes.txt bedrock_server_how_to.html valid_known_packs.json premium_cache 2> /dev/null - bkupDir=backup-pre-${VERSION} + bkupDir=/tmp/backup-pre-${VERSION} # fixup any previous interrupted upgrades rm -rf "${bkupDir}" for d in behavior_packs definitions minecraftpe resource_packs structures treatments world_templates @@ -96,6 +96,11 @@ if [ ! -f "bedrock_server-${VERSION}" ]; then mv $d $bkupDir fi done + # remove any old previous backups + shopt -s nullglob + for d in backup-pre-*; do + rm -rf $d + done # Do not overwrite existing files, which means the cleanup above needs to account for things # that MUST be replaced on upgrade