finally add toBackup instead of archiving only minecraft

This commit is contained in:
CeciliaKelley33Mm 2024-10-10 08:42:12 +07:00
parent 03b14c5190
commit 296f2764ca
2 changed files with 7 additions and 6 deletions

View file

@ -83,10 +83,10 @@ jobs:
tar xf archive.tar.gz
rm -rf archive.tar.gz
cd minecraft
cd toBackup/minecraft
else
mkdir /mnt/globalData/minecraft
cd /mnt/globalData/minecraft
mkdir -p /mnt/globalData/toBackup/minecraft
cd /mnt/globalData/toBackup/minecraft
wget -O docker-compose.yml https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/minecraft-compose.yml
fi
docker compose up -d &

View file

@ -105,7 +105,7 @@ check() {
if [[ "$IS_GLOBAL" == "true" ]]; then
command+="-f \"inputs[oldTailscaleHostname]=$hostname\""
cd /mnt/globalData/minecraft
cd /mnt/globalData/toBackup/minecraft
timeLeft=30
@ -120,13 +120,14 @@ check() {
done
# not stopping the server would cause problems
# like world files aren't latest or even file corruptions
# like new world files not getting written
# or even file corruptions
docker compose down
cd /mnt/globalData
# sudo is necessary because we run minecraft in a docker container
sudo tar cf archive.tar.gz minecraft/
sudo tar cf archive.tar.gz toBackup/
serve -p 5000 &
fi