Merge pull request #184 from Atriusftw/feature/BackupPreUpdate

Allow backing up prior to updating the server
This commit is contained in:
Marius Linge 2015-09-23 05:36:29 +02:00
commit c9ddb5c87d
3 changed files with 14 additions and 1 deletions

View File

@ -97,6 +97,9 @@ Validates all ARK server files
#### arkmanager update --update-mods #### arkmanager update --update-mods
Updates installed and requested mods Updates installed and requested mods
#### arkmanager update --backup
Takes a backup of the save files before updating.
#### arkmanager status #### arkmanager status
Get the status of the server. Show if the process is running, if the server is up and the current version number Get the status of the server. Show if the process is running, if the server is up and the current version number

View File

@ -692,6 +692,8 @@ doUpdate() {
saveworld=1 saveworld=1
elif [ "$arg" == "--update-mods" ]; then elif [ "$arg" == "--update-mods" ]; then
modupdate=1 modupdate=1
elif [ "$arg" == "--backup" ]; then
arkBackupPreUpdate=true
fi fi
done done
@ -738,6 +740,12 @@ doUpdate() {
doStop doStop
# If user wants to back-up, we do it here.
if [ "$arkBackupPreUpdate" == "true" ]; then
doBackup
fi
if [ -n "$appupdate" ]; then if [ -n "$appupdate" ]; then
cd "$steamcmdroot" cd "$steamcmdroot"
./$steamcmdexec +login anonymous +force_install_dir "$arkserverroot" +app_update $appid $validate +quit ./$steamcmdexec +login anonymous +force_install_dir "$arkserverroot" +app_update $appid $validate +quit
@ -1214,6 +1222,7 @@ while true; do
echo " --validate Validates all ARK server files" echo " --validate Validates all ARK server files"
echo " --saveworld Saves world before update" echo " --saveworld Saves world before update"
echo " --update-mods Updates installed and requested mods" echo " --update-mods Updates installed and requested mods"
echo " --backup Takes a backup of the save files before updating"
exit 1 exit 1
;; ;;
*) *)

View File

@ -15,6 +15,7 @@ arkserverexec="ShooterGame/Binaries/Linux/ShooterGameServer" # name of AR
arkbackupdir="/home/steam/ARK-Backups" # path to backup directory arkbackupdir="/home/steam/ARK-Backups" # path to backup directory
arkwarnminutes="60" # number of minutes to warn players when using update --warn arkwarnminutes="60" # number of minutes to warn players when using update --warn
arkautorestartfile="ShooterGame/Saved/.autorestart" # path to autorestart file 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 # Update warning messages
# Modify as desired, putting the %d replacement operator where the number belongs # Modify as desired, putting the %d replacement operator where the number belongs