dbaclone
dbaclone copied to clipboard
Remove Image unused and keep is per image instead of per database.
Before submitting the bug
- [x] Ensure you are able to reproduce it on the latest released version (we release often)
- [x] Verified this bug is not already reported in an issue
- [x] Verified errors are not related to permissions
- [x] Can reproduce in a clean PowerShell session (clean =
powershell -NoProfile
)
Describe the bug
When running the command:
Remove-DcnImage -unused -keep 1
I would expect the command to remove unused images and keep the most recent image for each database. However, removes all unused and keeps the most recent image.
For example, I have 3 database images created on 1/7 and generate a new image for each database on 2/7. This gives me the below table:
ImageID | Database | Used? | Created |
---|---|---|---|
1 | Db1 | unused | 1/7/2021 |
4 | Db1 | unused | 2/7/2021 |
2 | Db2 | unused | 1/7/2021 |
5 | Db2 | unused | 2/7/2021 |
3 | Db3 | unused | 1/7/2021 |
6 | Db3 | unused | 2/7/2021 |
When you run the above command it would remove all images, leaving only 1 image (ImageID 6). I would expect it to only remove the oldest image per database, leaving us with ImageID 4, 5, and 6.
Is this intended? Are you meant to specify the database when using -unused -keep [x]
?
I'm using dbaclone version: 0.10.38