SpaceSMP Minecraft Backup System!
Would you like to know how to backup your Minecraft Server, in a way that follows the 3-2-1 backup technique?
The setup for this is really simple, all that is needed is:
- Syncthing setup on 2 devices. I recommend the docker container
- A Minecraft Server
- Thats it!
Cost: Provided you already pay for a vps for your Minecraft server, you will only need one other device.
- SSH into your server device
Open a new file in your home folder called
backup.sh1
sudo nano ~/backup.shPut the following code inside the file
1 2 3 4 5 6 7 8 9 10 11
SRC="Youre Minecraft Server Directory" DEST="Your Syncthing Source Directory" mkdir -p "$DEST" NEW_BACKUP="$DEST/world-$(date +%Y%m%d-%H%M%S)" rsync -avh --progress --exclude='bluemap/' "$SRC" "$NEW_BACKUP/" cd "$DEST" || exit ls -1dt world-* | tail -n +3 | xargs -r rm -rf
This script copies your Minecraft Server Directory to your syncthing directory.
Open your cron file by running
1
crontab -eThen add this line at the bottom:
1
0 1 * * * /bin/bash ~/backup.sh
- In your server’s management panel, set the server to run the command
save-all2 minutes before 1am. - Inside syncthing, setup syncing to your other server.
- You’re done! Your server will now backup at 1am every day.
Thank you for reading ;)
Credits: DidiDidi129, eatyourgory
This post is licensed under CC BY 4.0 by the author.