Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed backup so only old backup files are deleted #215

Merged
merged 7 commits into from
Jan 31, 2024
6 changes: 1 addition & 5 deletions scripts/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,5 @@ echo "backup created at $FILE_PATH"

if [ "${DELETE_OLD_BACKUPS}" = true ]; then
echo "removing backups older than ${OLD_BACKUP_DAYS} days"
Dashboy1998 marked this conversation as resolved.
Show resolved Hide resolved
if [ "$(id -u)" -eq 0 ]; then
su steam -c "find /palworld/backups/ -mindepth 1 -maxdepth 1 -mtime "+${OLD_BACKUP_DAYS}" -type f -name 'palworld-save-*.tar.gz' -print -delete"
else
find /palworld/backups/ -mindepth 1 -maxdepth 1 -mtime "+${OLD_BACKUP_DAYS}" -type f -name 'palworld-save-*.tar.gz' -print -delete
fi
Dashboy1998 marked this conversation as resolved.
Show resolved Hide resolved
find /palworld/backups/ -mindepth 1 -maxdepth 1 -mtime "+${OLD_BACKUP_DAYS}" -type f -name 'palworld-save-*.tar.gz' -print -delete
fi