Schaka / janitorr

Cleans your Radarr, Sonarr, Jellyseerr and Jellyfin before you run out of space
GNU General Public License v3.0
263 stars 5 forks source link

Add option to only delete files when free disk space reaches a threshold #2

Closed majatocaha closed 6 months ago

majatocaha commented 7 months ago

I'd love to see that functionality, as sometimes no new media is added for a while, thus removing my need to delete existing files for that duration. Maybe optionally usable with a setting in application.yml?

Could be working like this:

Existing media: A -> age 95 days, 10GB B -> age 92 days, 20GB

Free disk space left is 5GB, Threshold for deletion is 10GB free disk space. Cleanup task would result in "A" being deleted, and "B" not being deleted, as the free disk space is now 15GB, which is higher than the threshold.

This way, media will only be deleted if it actually becomes necessary to expand free disk space.

Schaka commented 6 months ago

This is now available on develop and will be in the next release (1.0).

I decided against rechecking disk space after each delete. As Janitorr should run continously, I'm not too worried about micro optimizing.