1
0
Fork 0
This repository has been archived on 2025-08-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
backup-minecraft-servers/Makefile
2023-09-26 21:51:39 +00:00

28 lines
1.3 KiB
Makefile

.PHONY: local-clean-cache
local-clean-cache:
rm -rf $(find -type d -name 'cache')
rm -rf $(find -type d -name 'logs')
rm -rf ./proxy/anvil
.PHONY: upgrade-remote
upgrade-servers: local-clean-cache
ssh koala -t "systemctl list-units --type=service --state=running | grep 'Minecraft Server' | awk '{print $1}' | xargs systemctl stop"
rsync -avH ./servers -e ssh root@koala.vxm.cz:/opt/minecraft
ssh koala -t "chown -R minecraft:minecraft /opt/minecraft/servers"
ssh koala -t "systemctl list-units --type=service --state=stopped | grep 'Minecraft Server' | awk '{print $1}' | xargs systemctl start"
.PHONY: upgrade-proxy
upgrade-proxy: local-clean-cache
ssh koala -t "systemctl stop velocity"
rsync -avH ./proxy -e ssh root@koala.vxm.cz:/opt/minecraft
ssh koala -t "chown -R minecraft:minecraft /opt/minecraft/proxy"
ssh koala -t "systemctl start velocity"
.PHONY: upgrade-systemd
upgrade-systemd:
ssh koala -t "systemctl list-units --type=service --state=running | grep 'Minecraft Server' | awk '{print $1}' | xargs systemctl stop"
ssh koala -t "systemctl stop velocity"
rsync -avH ./.systemd/* -e ssh root@koala.vxm.cz:/etc/systemd/system/
systemctl daemon-reload
ssh koala -t "systemctl list-units --type=service --state=stopped | grep 'Minecraft Server' | awk '{print $1}' | xargs systemctl start"
ssh koala -t "systemctl start velocity"