Add backup script
Signed-off-by: AKP <tom@tdpain.net>
This commit is contained in:
parent
3e03f09bdc
commit
d26eeefb7e
1 changed files with 33 additions and 0 deletions
33
backup.sh
Normal file
33
backup.sh
Normal 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
|
Reference in a new issue