Prevent disk_check from erasing our "Best Recordings"

let me know what you think

@mcguirepr89
This commit is contained in:
ehpersonal38
2022-05-09 10:35:34 -04:00
parent aa4908559c
commit 732f33d933
2 changed files with 26 additions and 4 deletions
+16 -2
View File
@@ -7,8 +7,22 @@ if [ "${used//%}" -ge 95 ]; then
case $FULL_DISK in
purge) echo "Removing oldest data"
rm -drfv "$(find ${EXTRACTED}/By_Date/* -maxdepth 1 -type d -prune \
| sort -r | tail -n1)";;
cd ${EXTRACTED}/By_Date/
iter=0
for i in */*/*; do
if [ $iter -ge 250 ]; then
break
fi
if ! grep -qxFe "$i" $HOME/BirdNET-Pi/scripts/disk_check_exclude.txt; then
rm "$i"
fi
((iter++))
done
find ${EXTRACTED}/By_Date/ -empty -type d -delete;;
#rm -drfv "$(find ${EXTRACTED}/By_Date/* -maxdepth 1 -type d -prune \
# | sort -r | tail -n1)";;
keep) echo "Stopping Core Services"
/usr/local/bin/stop_core_services.sh;;
esac