automate automation for minecraft servers
Go to file
ida schmidt 0f16466a9e support java versioning for minecraft 1.21 2024-06-23 21:48:49 +01:00
systemd limit backup cpu usage 2023-07-08 20:45:49 -07:00
LICENSE Initial commit 2020-04-01 03:49:15 +00:00
README.md support java versioning for minecraft 1.21 2024-06-23 21:48:49 +01:00
automate.sh support java versioning for minecraft 1.21 2024-06-23 21:48:49 +01:00

README.md

auto-mc

automate automation for minecraft servers.

this is an installer for the minecraft server (paper), with a few systemd units and a backup script. the server runs inside a gnu screen session controlled by the user mc. it works best on ubuntu 20.04+ because of java versioning, but any distro with apt (and a version of openjdk >=16 for 1.17+ installs, or >=21 for 1.21+) should work fine.

installation

to install, do:

sudo apt install git
git clone https://git.skeh.site/ida/auto-mc ~/auto-mc 
cd ~/auto-mc && sudo bash automate.sh

usage notes

by default the server tries to allocate 3G of ram, to change this, just edit mc-server.service's ExecStart

structure

/srv/minecraft/server: server files

/srv/minecraft/backups: backups of ../server (taken daily, retained for 14 days)

/etc/systemd/system/mc-*: services and timers

commands

ran as root*:

systemctl start mc-server: starts the minecraft server

systemctl stop mc-server: stops the minecraft server

systemctl restart mc-server: restarts the minecraft server

(* = either by logging into root, or prefixing any command with sudo)

ran as mc

screen -r mc-server: connects to the server console

mc-backup: manually runs a backup