diff --git a/README.asciidoc b/README.asciidoc index 6969e89..9aae3e1 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -501,6 +501,11 @@ The following options can be overridden on a per-instance basis: The directory in which to store backups. Can be overridden in the instance config. +`arkBackupPostCommand`:: + Command to be run using `eval` after backup completes. + `$backupfile` will be set to the full path of the backup tar.bz2 file. + e.g. `arkBackupPostCommand='aws s3 cp "$backupfile" "s3://bucket_name/backups"'` + `arkwarnminutes`:: The number of minutes over which the shutdown and update warnings should be run diff --git a/tools/arkmanager b/tools/arkmanager index ac0b7b7..e3b966d 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -2836,6 +2836,7 @@ doBackup(){ local savedcfgdir="${saverootdir}/Config/LinuxServer" local savedir="$(getSavedArksDirectory "${saverootdir}")" local mapname="$(getServerMapName)" + local backupfile mkdir -p "$backupdir" mkdir -p "$backupdirdaily" @@ -3015,11 +3016,12 @@ doBackup(){ #Tar the files and remove the original Backup Directory. Saves about 50MB of disk space per backup echo -ne "${NORMAL} Compressing Backup " + backupfile="${arkbackupdir}/${daystamp}/${instance}.${datestamp}.tar.bz2" - tar -jcf "${arkbackupdir}/${daystamp}/${instance}.${datestamp}.tar.bz2" -C "${arkbackupdir}" "${datestamp}" + tar -jcf "${backupfile}" -C "${arkbackupdir}" "${datestamp}" rm -rf ${backupdir} - if [ -f "${arkbackupdir}/${daystamp}/${instance}.${datestamp}.tar.bz2" ]; then + if [ -f "${backupfile}" ]; then echo -e "${NORMAL}\e[68G[ ${GREEN}OK${NORMAL} ]" else echo -e "${NORMAL}\e[68G[ ${RED}FAILED${NORMAL} ]" @@ -3041,6 +3043,10 @@ doBackup(){ (( sz += fsz )) done) fi + + if [ -n "${arkPostBsckupCommand}" ] && [ -f "${backupfile}" ]; then + eval " ${arkPostBsckupCommand}" + fi } # diff --git a/tools/arkmanager.cfg b/tools/arkmanager.cfg index ecad5f0..3c8185c 100644 --- a/tools/arkmanager.cfg +++ b/tools/arkmanager.cfg @@ -19,6 +19,7 @@ arkwarnminutes="60" # number of arkautorestartfile="ShooterGame/Saved/.autorestart" # path to autorestart file arkAutoUpdateOnStart="false" # set this to true if you want to always update before startup arkBackupPreUpdate="false" # set this to true if you want to perform a backup before updating +# arkBackupPostCommand='aws s3 cp "$backupfile" "s3://bucket_name/backups"' # Set this if you want a command to run after performing a backup #arkStartDelay=20 # set this to change the maximum delay between server starts - 0 or unser for no delay, will continue immediately when server is up #defaultinstance_max=20 # Same as above, for v1.6.43 compatibility #arkStagingDir="/home/steam/ARK-Staging" # Uncomment to enable updates to be fully downloaded before restarting the server (reduces downtime while updating)