File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ For Minecraft Java Edition you'll need to use this image instead:
38
38
bedrock server process
39
39
- ` GID ` (default derived from ` /data ` owner) : can be set to a specific group ID to run the
40
40
bedrock server process
41
+ - ` PACKAGE_BACKUP_KEEP ` (` 2 ` ) : how many package backups to keep
41
42
42
43
### Server Properties
43
44
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ if [ ! -f "bedrock_server-${VERSION}" ]; then
83
83
fi
84
84
85
85
# remove only binaries and some docs, to allow for an upgrade of those
86
- rm -rf bedrock_server * .so release-notes.txt bedrock_server_how_to.html valid_known_packs.json premium_cache 2> /dev/null
86
+ rm -rf bedrock_server bedrock_server- * * .so release-notes.txt bedrock_server_how_to.html valid_known_packs.json premium_cache 2> /dev/null
87
87
88
88
bkupDir=backup-pre-${VERSION}
89
89
# fixup any previous interrupted upgrades
@@ -97,6 +97,15 @@ if [ ! -f "bedrock_server-${VERSION}" ]; then
97
97
fi
98
98
done
99
99
100
+ # remove old package backups, but keep PACKAGE_BACKUP_KEEP
101
+ if (( ${PACKAGE_BACKUP_KEEP:= 2} >= 0 )) ; then
102
+ shopt -s nullglob
103
+ for d in $( ls -td1 backup-pre-* | tail +$(( PACKAGE_BACKUP_KEEP + 1 )) ) ; do
104
+ echo " Pruning $d "
105
+ rm -rf $d
106
+ done
107
+ fi
108
+
100
109
# Do not overwrite existing files, which means the cleanup above needs to account for things
101
110
# that MUST be replaced on upgrade
102
111
unzip -q -n ${TMP_ZIP}
You can’t perform that action at this time.
0 commit comments