diff --git a/README.md b/README.md index 8942613..92b3b46 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,9 @@ Validates all ARK server files #### arkmanager update --update-mods Updates installed and requested mods +#### arkmanager update --backup +Takes a backup of the save files before updating. + #### arkmanager status Get the status of the server. Show if the process is running, if the server is up and the current version number diff --git a/tools/arkmanager b/tools/arkmanager index c268785..b6e47ce 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -692,6 +692,8 @@ doUpdate() { saveworld=1 elif [ "$arg" == "--update-mods" ]; then modupdate=1 + elif [ "$arg" == "--backup" ]; then + arkBackupPreUpdate=true fi done @@ -737,6 +739,12 @@ doUpdate() { fi doStop + + # If user wants to back-up, we do it here. + + if [ "$arkBackupPreUpdate" == "true" ]; then + doBackup + fi if [ -n "$appupdate" ]; then cd "$steamcmdroot" @@ -754,7 +762,7 @@ doUpdate() { fi done fi - + # we restart the server only if it was started before the update if [ $serverWasAlive -eq 1 ]; then doStart @@ -1214,6 +1222,7 @@ while true; do echo " --validate Validates all ARK server files" echo " --saveworld Saves world before update" echo " --update-mods Updates installed and requested mods" + echo " --backup Takes a backup of the save files before updating" exit 1 ;; *) diff --git a/tools/arkmanager.cfg b/tools/arkmanager.cfg index 024a940..094df34 100644 --- a/tools/arkmanager.cfg +++ b/tools/arkmanager.cfg @@ -15,6 +15,7 @@ arkserverexec="ShooterGame/Binaries/Linux/ShooterGameServer" # name of AR arkbackupdir="/home/steam/ARK-Backups" # path to backup directory arkwarnminutes="60" # number of minutes to warn players when using update --warn arkautorestartfile="ShooterGame/Saved/.autorestart" # path to autorestart file +arkBackupPreUpdate="false" # set this to true if you want to perform a backup before updating # Update warning messages # Modify as desired, putting the %d replacement operator where the number belongs