mc-backup now stops server and outputs tar.ztd to stdout
this is motivated by wanting to redirect the world/server files after provisioning, according to user config. .hushlogin was added to root's home dir as to not interfere with directly piping ssh's mc-backup output to a file
This commit is contained in:
parent
e284bb605d
commit
4f79143cba
1 changed files with 3 additions and 2 deletions
|
@ -23,7 +23,7 @@ fi
|
|||
|
||||
echo "preparing..." # making sure things have the right owners
|
||||
adduser --disabled-password --gecos "" mc
|
||||
mkdir -p /srv/minecraft/{server,backups}
|
||||
mkdir -p /srv/minecraft/server
|
||||
cat <<- 'EOF' > /etc/systemd/system/mc-server.service
|
||||
[Unit]
|
||||
Description=Minecraft server
|
||||
|
@ -46,7 +46,8 @@ echo "PATH=/root/.local/bin/:$PATH" >> /root/.bashrc #FIXME: needs to me made im
|
|||
|
||||
cat <<- 'EOF' > /root/.local/bin/mc-backup
|
||||
#!/usr/bin/env bash
|
||||
tar -caf /srv/minecraft/backups/server.tar.xz /srv/minecraft/server/
|
||||
systemctl stop mc-server
|
||||
tar -c -f - /srv/minecraft/server/ | zstd
|
||||
EOF
|
||||
|
||||
chown root:root /root/.local/bin/mc-backup
|
||||
|
|
Loading…
Add table
Reference in a new issue