diff --git a/scripts/backup.sh b/scripts/backup.sh index 43eecb4..726f698 100644 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -15,3 +15,8 @@ if [ "$(id -u)" -eq 0 ]; then fi echo "backup created at $FILE_PATH" + +if [ "${DELETE_OLD_BACKUPS}" = true ]; then + echo "removing backups older than $OLD_BACKUP_DAYS days" + find /palworld/backups/ -mindepth 1 -maxdepth 1 -mtime +$OLD_BACKUP_DAYS -print -delete +fi