A few utility bash scripts I wrote that
- start an already-installed vanilla Minecraft server on system boot,
- keep an up-to-date incremental backup of the world and server files,
- as well as daily snapshots for the history books,
- and optionally purge old snapshots whenever disk space runs low.
In principle, these scripts should work on any *nix system (e.g. macOS or any Linux distribution). However, I have only tested them on a ridiculously old (but still almost fast enough to host a Minecraft server for two people) laptop running Ubuntu 14.04.4 LTS.
-
Make sure that
bash
,cron
andrsync
(among others) are installed on your system (if you're not sure, you likely have them). Then installscreen
:apt-get install screen
-
Now, modify the included file
.mcsurc
according to the instructions in the file and copy it to your home directory:# first modify .mcsurc, then: cp .mcsurc ~
-
Finally, set up your crontab: Run
crontab -e
and paste the contents ofmcsu.crontab
at the end of the buffer. If you don't want to purge old snapshots, comment-out the corresponding line.
After completing these steps, reboot. Once your system is up again, the Minecraft server should be up and running (you can manage it by running screen -r mcs
to attach to the screen session and pressing first ctrl+A, then D to deattach) and backups should be performed regularly (check this by looking at the target directory you've configured in step 2, or if it's still empty after a while, inspect the log files).