From cb7ab15f692f1c3944c447a07c561776a0c6cc90 Mon Sep 17 00:00:00 2001 From: Marius Linge Date: Sun, 20 Sep 2015 08:19:24 +0200 Subject: [PATCH 1/5] Checks if user wants to perform a backup prior to updating if a new version is available --- tools/arkmanager | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/arkmanager b/tools/arkmanager index 5df729b..4c9a823 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -639,6 +639,9 @@ doUpdate() { doStop if [ -n "$appupdate" ]; then + if [ "$arkBackupPreUpdate" == "true" ]; then + doBackup + fi cd "$steamcmdroot" ./$steamcmdexec +login anonymous +force_install_dir "$arkserverroot" +app_update $appid $validate +quit # the current version should be the last version. We set our version From 94b3138988641a96c9645f2df5c8081466517486 Mon Sep 17 00:00:00 2001 From: Marius Linge Date: Sun, 20 Sep 2015 08:20:02 +0200 Subject: [PATCH 2/5] Adds a configuration value to allow backup prior to updating the server --- tools/arkmanager.cfg | 1 + 1 file changed, 1 insertion(+) 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 From 115f0c3ce7e6418658bd9c9c542ddb7bf8e93725 Mon Sep 17 00:00:00 2001 From: Marius Linge Date: Tue, 22 Sep 2015 19:42:50 +0200 Subject: [PATCH 3/5] Improves the backup on-request feature --- tools/arkmanager | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/arkmanager b/tools/arkmanager index 4c9a823..1ad3638 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -592,6 +592,8 @@ doUpdate() { saveworld=1 elif [ "$arg" == "--update-mods" ]; then modupdate=1 + elif [ "$arg" == "--backup" ]; then + arkBackupPreUpdate=true fi done @@ -637,11 +639,14 @@ doUpdate() { fi doStop + + # If user wants to back-up, we do it here. + + if [ "$arkBackupPreUpdate" == "true" ]; then + doBackup + fi if [ -n "$appupdate" ]; then - if [ "$arkBackupPreUpdate" == "true" ]; then - doBackup - fi cd "$steamcmdroot" ./$steamcmdexec +login anonymous +force_install_dir "$arkserverroot" +app_update $appid $validate +quit # the current version should be the last version. We set our version @@ -657,7 +662,7 @@ doUpdate() { fi done fi - + # we restart the server only if it was started before the update if [ $serverWasAlive -eq 1 ]; then doStart From a9f2c5401f183499a7a9e9b47b893881ee30cb83 Mon Sep 17 00:00:00 2001 From: Marius Linge Date: Wed, 23 Sep 2015 02:34:42 +0200 Subject: [PATCH 4/5] Adds the new command to README --- README.md | 3 +++ 1 file changed, 3 insertions(+) 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 From 47c070a21c2d940afb0c51d8c52ef3343fc7caf3 Mon Sep 17 00:00:00 2001 From: Marius Linge Date: Wed, 23 Sep 2015 02:35:12 +0200 Subject: [PATCH 5/5] Adds the new command to arkmanager help --- tools/arkmanager | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/arkmanager b/tools/arkmanager index 1ad3638..23b3cf1 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -1180,6 +1180,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 ;; *)