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
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

View File

@ -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
;;
*)

View File

@ -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