Add backup script

Signed-off-by: AKP <tom@tdpain.net>
This commit is contained in:
akp 2023-03-28 18:13:25 +01:00
parent 3e03f09bdc
commit d26eeefb7e
No known key found for this signature in database
GPG key ID: AA5726202C8879B7

33
backup.sh Normal file
View file

@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -ex
cd /root
TARGET="@a"
docker exec mc mc-send-to-console title $TARGET title '\"Server restarting in \\u00A7c1 minute\"'
docker exec mc mc-send-to-console title $TARGET actionbar '\"This is so backups can be performed\"'
sleep 30
docker exec mc mc-send-to-console title $TARGET title '\"Server restarting in \\u00A7c30 seconds\"'
docker exec mc mc-send-to-console title $TARGET actionbar '\"This is so backups can be performed\"'
sleep 30
docker exec mc mc-send-to-console title $TARGET title '\"\\u00A7cRestarting...\"'
curl -m 10 --retry 5 https://hc-ping.com/808c9be1-26d3-425b-a056-8c324d9e39d0/start
docker stop mc
OUTPUT_FILE="backup.tar.gz"
tar czf $OUTPUT_FILE data/whitelist.json data/ops.json data/server.properties data/lgbtqeaster/
docker start mc
./rclone copy $OUTPUT_FILE backblazebackups:akp-backups/lgbtq-mc
rm $OUTPUT_FILE
curl -m 10 --retry 5 https://hc-ping.com/808c9be1-26d3-425b-a056-8c324d9e39d0