Merge pull request #188 from sugoidogo/patch-1

optionally delete old backups
This commit is contained in:
Thijs van Loef
2024-01-29 17:56:10 +01:00
committed by GitHub
2 changed files with 7 additions and 0 deletions

View File

@@ -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:=30} days"
find /palworld/backups/ -mindepth 1 -maxdepth 1 -mtime "+${OLD_BACKUP_DAYS}" -print -delete
fi