Add ark backup feature

This commit is contained in:
Ben Peddell 2015-07-08 22:26:13 +10:00
parent 0ea4ae4782
commit c8f8ae87f6
2 changed files with 16 additions and 0 deletions

View File

@ -335,6 +335,18 @@ safeUpdate(){
fi
}
#
# Copies server state to a backup directory
#
doBackup(){
local datestamp=`date +"%Y-%m-%d_%H.%M.%S"`
local backupdir="${arkbackupdir}/${datestamp}"
mkdir -p "$backupdir"
cp "${arkserverroot}/ShooterGame/Saved/SavedArks/${serverMap}.ark" "${backupdir}/${serverMap}.ark"
cp "${arkserverroot}/ShooterGame/Saved/SavedArks/"*.arkprofile "${backupdir}"
cp "${arkserverroot}/ShooterGame/Saved/SavedArks/"*.arktribe "${backupdir}"
cp "${arkserverroot}/ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini" "${backupdir}"
}
#
# Print the status of the server (running? online? version?)
@ -407,6 +419,9 @@ case "$1" in
checkupdate)
checkForUpdate
;;
backup)
doBackup
;;
broadcast)
doInfo $2
;;

View File

@ -10,6 +10,7 @@ steamcmd_appinfocache="/home/steam/Steam/appcache/appinfo.vdf" # cache of t
# config environment
arkserverroot="/home/steam/ARK" # path of your ARK server files (default ~/ARK)
arkserverexec="ShooterGame/Binaries/Linux/ShooterGameServer" # name of ARK server executable
arkbackupdir="/home/steam/ARK-Backups" # path to backup directory
# ARK server options - use ark_<optionname>=<value>
# comment out these values if you want to define them