mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-24 07:28:27 +00:00
Merge pull request #303 from klightspeed/1.5-dev#limitbackupsize
Implement old backup removal by limiting backup size
This commit is contained in:
commit
e688c69719
@ -1427,6 +1427,22 @@ doBackup(){
|
|||||||
echo -e "${NORMAL}\e[68G[ ${RED}FAILED${NORMAL} ]"
|
echo -e "${NORMAL}\e[68G[ ${RED}FAILED${NORMAL} ]"
|
||||||
fi
|
fi
|
||||||
echo -e "${NORMAL} Created Backup: ${GREEN} ${datestamp}.tar.bz2${NORMAL}"
|
echo -e "${NORMAL} Created Backup: ${GREEN} ${datestamp}.tar.bz2${NORMAL}"
|
||||||
|
|
||||||
|
if [ -n "$arkMaxBackupSizeGB" ] && (( arkMaxBackupSizeGB >= 1 )); then
|
||||||
|
(( arkMaxBackupSizeMB = arkMaxBackupSizeGB * 1024 ))
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$arkMaxBackupSizeMB" ] && (( arkMaxBackupSizeMB > 64 )); then
|
||||||
|
find "${arkbackupdir}" -type f -printf "%T@\t%s\t%p\n" |
|
||||||
|
sort -n -r |
|
||||||
|
cut -f2-3 |
|
||||||
|
(sz=0; while read fsz f; do
|
||||||
|
if (( sz / 1048576 > arkMaxBackupSizeMB )); then
|
||||||
|
rm "$f"
|
||||||
|
fi
|
||||||
|
(( sz += fsz ))
|
||||||
|
done)
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -16,9 +16,13 @@ arkbackupdir="/home/steam/ARK-Backups" # path to ba
|
|||||||
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
|
arkBackupPreUpdate="false" # set this to true if you want to perform a backup before updating
|
||||||
arkTimeToKeepBackupFiles="10" #Set to Automatically Remove backups older than n days
|
|
||||||
#arkStagingDir="/home/steam/ARK-Staging" # Uncomment to enable updates to be fully downloaded before restarting the server (reduces downtime while updating)
|
#arkStagingDir="/home/steam/ARK-Staging" # Uncomment to enable updates to be fully downloaded before restarting the server (reduces downtime while updating)
|
||||||
|
|
||||||
|
# Options to automatically remove old backups to keep backup size in check
|
||||||
|
# Each compressed backup is generally about 1-2MB in size.
|
||||||
|
arkMaxBackupSizeMB="500" # Set to automatically remove old backups when size exceeds this limit
|
||||||
|
#arkMaxBackupSizeGB="2" # Uncomment this and comment the above to specify the limit in whole GB
|
||||||
|
|
||||||
# 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
|
||||||
msgWarnUpdateMinutes="This ARK server will shutdown for an update in %d minutes"
|
msgWarnUpdateMinutes="This ARK server will shutdown for an update in %d minutes"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user