From aa0372079feeb3ec8831f908b441285d6b5c098f Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Mon, 9 May 2022 15:43:48 -0400 Subject: [PATCH] Update disk_check.sh more reasonable number to delete --- scripts/disk_check.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/disk_check.sh b/scripts/disk_check.sh index 635cee1..e7a60a8 100755 --- a/scripts/disk_check.sh +++ b/scripts/disk_check.sh @@ -9,9 +9,10 @@ if [ "${used//%}" -ge 95 ]; then purge) echo "Removing oldest data" cd ${EXTRACTED}/By_Date/ curl localhost/views.php?view=Species%20Stats &>/dev/null + filestodelete=$(($(find ${EXTRACTED}/By_Date/* -type f | wc -l) / $(find ${EXTRACTED}/By_Date/* -maxdepth 0 -type d | wc -l))) iter=0 for i in */*/*; do - if [ $iter -ge 250 ]; then + if [ $iter -ge $filestodelete ]; then break fi if ! grep -qxFe "$i" $HOME/BirdNET-Pi/scripts/disk_check_exclude.txt; then