updated the disk-check utility to have options for removing old data

or stopping core services
This commit is contained in:
mcguirepr89
2022-01-19 10:49:41 -05:00
parent 0806f86bfd
commit d570324ac7
4 changed files with 31 additions and 3 deletions
+10 -3
View File
@@ -2,7 +2,14 @@
set -x
used="$(df -h / | tail -n1 | awk '{print $5}')"
if [ "${used//%}" -gt 95 ]; then
echo "Stopping Core Services"
/usr/local/bin/stop_core_services.sh
if [ "${used//%}" -ge 95 ]; then
source /etc/birdnet/birdnet.conf
case $FULL_DISK in
0) echo "Removing oldest data"
rm -drfv "$(find ${EXTRACTED}/By_Date/* -maxdepth 1 -type d -prune \
| sort -r | tail -n1)";;
*) echo "Stopping Core Services"
/usr/local/bin/stop_core_services.sh;;
esac
fi