-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add Purge Threshold #256
base: main
Are you sure you want to change the base?
Add Purge Threshold #256
Conversation
Adds a purge threshold setting. This setting allows the user to control at what filled percentage the purge activities are run. This replaces the default, hard coded 95% point. The purge threshold defaults at the original 95%. I set a minimum of 20 and max of 99 because those values felt sensible but am open to changing those based on feedback. Note: The purge threshold is still active when the keep option is set. I added a note for this but this still presents some risk where users who change this while in Keep mode could have their services shut down earlier than they expect.
Adds a purge threshold setting. This setting allows the user to control at what filled percentage the purge activities are run. This replaces the default, hard coded 95% point. The purge threshold defaults at the original 95%. I set a minimum of 20 and max of 99 because those values felt sensible but am open to changing those based on feedback. Note: The purge threshold is still active when the keep option is set. I added a note for this but this still presents some risk where users who change this while in Keep mode could have their services shut down earlier than they expect. Patch: Fix a couple of typos in initial changes and improve formatting.
Hi, indeed looks useful for people who want to avoid being at limit of their disks ; or who share their system with data storage with another app |
the 'Amount of files to keep for each species' setting is meant to further limit the space if that 95% safety valve does not do. |
I had tried it and admittedly wasn't very patient nor did I take the time to debug it but for whatever reason it didn't clear up my usage, at least as fast as I had expected. By the time this drew my attention, it was a problem for my Pi so I was trying to take the most direct path. I'm going to change my threshold back to 95% and set it to keep all files and let it build up some data over the next few days. I'll report back on that as an issue if my debugging of the 'keep x files' functionality truly isn't working as it should be. Having said that, it feels a bit off to me that two parallel but unlinked methods of managing disk space are implemented. Im wondering if there is appetite for a rewrite of the disk management scripts into a single authoritative script? |
Hi, the cron job only every day at 2am. In theory this should be enough. Watch-out that it all depends on the number of birds : if you have 100 species with 100 recordings of mp3 at 4mo, that makes 40 Go :-) Execute this script and it will show you the number of recordings available for each of your species. Please keep in mind that you will often have more files than the minimum set : the files from the last 30 days are protected, as well as all files with a no-purge tag.
|
This is the part I was missing. For whatever reason I assumed that it ran as frequently as the disk check script. I switched to this repo after discovering the issue and realizing mcguirepr89's was unmaintained. The 'keep x files' would have never run based on my series of events. |
Problem
Currently, the threshold at which files are purged from disk is hard coded at 95%. Depending on users and systems this can be either too high or too low. Editing the threshold to adjust for user preferences would have to be done in the script where the disk cleanup is run. This is less than ideal because it puts this control out of scope for less technical users and would be wiped out or cause issues during updates.
Proposed Change
Add a purge threshold setting. This setting allows the user to control at what filled percentage the purge activities are run.
Detailed Description of Changes
Adds a configuration item to
advanced.php
to set the purge threshold. Also adds relevant description and warnings.Adds a snippet to
update_birdnet_snippets.sh
to set the default purge threshold. The default matches the threshold that was previously hardcoded.Changes the space equivalence check in
disk_check.sh
to use the newly defined purge threshold.Adds the purge threshold to
install_config.sh