From b229a475f180ef95eb178c5d86a1cb26cc1eb35e Mon Sep 17 00:00:00 2001 From: simylein <67859356+simylein@users.noreply.github.com> Date: Wed, 16 Dec 2020 22:49:46 +0100 Subject: [PATCH] added backup before update --- update.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/update.sh b/update.sh index 4e81e3f..33f8219 100644 --- a/update.sh +++ b/update.sh @@ -48,6 +48,11 @@ if screen -list | grep -q "${servername}"; then screen -S ${servername} -X quit fi +# create backup +echo -e "${blue}backing up...${nocolor}" +cp -r ${serverdirectory}/world ${backupdirectory}/update-${newdaily}-${newhourly} + + # Test internet connectivity and update on success wget --spider --quiet https://launcher.mojang.com/v1/objects/35139deedbd5182953cf1caa23835da59ca3d7cd/server.jar if [ "$?" != 0 ]; then