Changed backup so only old backup files are deleted
Open
Dashboy1998
opened this issue 1 year ago
•
0 comments
Context
- Currently anything older than
OLD_BACKUP_DAYS in the backup folder is deleted including directories or non backup files
- Changes here ensure only only backup files are deleted
Choices
- Added additional flag to delete only files
- Added additional flag so only backups which have not had the names modified are deleted
Test instructions
- Start container with
DELETE_OLD_BACKUPS=true
- Enter container:
docker exec -it palworld-server bash
- Create at least 4 backups
- Go to the backup folder:
cd /palworld/backups
- Change of the modified date the backups:
find /palworld/backups/ -exec touch -d "9001 days ago" {} \;
- Create 2 directories:
mkdir keep empty
- Move a backup to keep:
mv palworld-save-2024-01-.... keep/
- Rename one backup:
mv palworld-save-2024-01-.... important_palworld-save-2024-01-....
- Run backup
- Verify that empty and keep directories still exists
- Verify the backup in keep still exists
- Verify that the backup which you renamed still exists
Checklist before requesting a review
- [x] I have performed a self-review of my code
- [x] I've added documentation about this change to the README.
- [x] I've not introduced breaking changes.