Number of package backups can be configured with PACKAGE_BACKUP_KEEP
#150
This commit is contained in:
1 parent
f4081e06be
commit
2f6ea327d1
2 files changed
+11
-1
No files matched your search
@@ -38,6 +38,7 @@ For Minecraft Java Edition you'll need to use this image instead:
|
|||||||
bedrock server process
|
bedrock server process
|
||||||
- `GID` (default derived from `/data` owner) : can be set to a specific group ID to run the
|
- `GID` (default derived from `/data` owner) : can be set to a specific group ID to run the
|
||||||
bedrock server process
|
bedrock server process
|
||||||
|
- `PACKAGE_BACKUP_KEEP` (`2`) : how many package backups to keep
|
||||||
|
|
||||||
### Server Properties
|
### Server Properties
|
||||||
|
|
||||||
|
|||||||
+10
-1
@@ -83,7 +83,7 @@ if [ ! -f "bedrock_server-${VERSION}" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# remove only binaries and some docs, to allow for an upgrade of those
|
# 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
|
rm -rf bedrock_server 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=backup-pre-${VERSION}
|
||||||
# fixup any previous interrupted upgrades
|
# fixup any previous interrupted upgrades
|
||||||
@@ -97,6 +97,15 @@ if [ ! -f "bedrock_server-${VERSION}" ]; then
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# remove old package backups, but keep PACKAGE_BACKUP_KEEP
|
||||||
|
if (( ${PACKAGE_BACKUP_KEEP:=2} >= 0 )); then
|
||||||
|
shopt -s nullglob
|
||||||
|
for d in $( ls -td1 backup-pre-* | tail +$(( PACKAGE_BACKUP_KEEP + 1 )) ); do
|
||||||
|
echo "Pruning $d"
|
||||||
|
rm -rf $d
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# Do not overwrite existing files, which means the cleanup above needs to account for things
|
# Do not overwrite existing files, which means the cleanup above needs to account for things
|
||||||
# that MUST be replaced on upgrade
|
# that MUST be replaced on upgrade
|
||||||
unzip -q -n ${TMP_ZIP}
|
unzip -q -n ${TMP_ZIP}
|
||||||
|
|||||||
Reference in new issue
Block a user