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 tar xf archive.tar.gz
rm -rf archive.tar.gz rm -rf archive.tar.gz
cd minecraft cd toBackup/minecraft
else else
mkdir /mnt/globalData/minecraft mkdir -p /mnt/globalData/toBackup/minecraft
cd /mnt/globalData/minecraft cd /mnt/globalData/toBackup/minecraft
wget -O docker-compose.yml https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/minecraft-compose.yml wget -O docker-compose.yml https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/minecraft-compose.yml
fi fi
docker compose up -d & docker compose up -d &

View file

@ -105,7 +105,7 @@ check() {
if [[ "$IS_GLOBAL" == "true" ]]; then if [[ "$IS_GLOBAL" == "true" ]]; then
command+="-f \"inputs[oldTailscaleHostname]=$hostname\"" command+="-f \"inputs[oldTailscaleHostname]=$hostname\""
cd /mnt/globalData/minecraft cd /mnt/globalData/toBackup/minecraft
timeLeft=30 timeLeft=30
@ -120,13 +120,14 @@ check() {
done done
# not stopping the server would cause problems # 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 docker compose down
cd /mnt/globalData cd /mnt/globalData
# sudo is necessary because we run minecraft in a docker container # 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 & serve -p 5000 &
fi fi