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
+6
View File
@@ -263,6 +263,12 @@ SENSITIVITY=1.25
CHANNELS=2
## FULL_DISK can be set to configure how the system reacts to a full disk
## 0 = Remove the oldest day's worth of recordings
## 1 = Keep all data and 'stop_core_services.sh'
FULL_DISK=0
## VENV is the virtual environment where the the BirdNET python build is found,
## i.e, VENV is the virtual environment miniforge built for BirdNET.
+9
View File
@@ -175,6 +175,12 @@ SENSITIVITY=1.25
CHANNELS=2
## FULL_DISK can be set to configure how the system reacts to a full disk
## 0 = Remove the oldest day's worth of recordings
## 1 = Keep all data and `stop_core_services.sh`
FULL_DISK=0
## VENV is the virtual environment where the the BirdNET python build is found,
## i.e, VENV is the virtual environment miniforge built for BirdNET.
@@ -196,3 +202,6 @@ BIRDNET_USER=pi
## These are just for debugging
LAST_RUN=
THIS_RUN=
## These are just for debugging
LAST_RUN=
THIS_RUN=
+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
+6
View File
@@ -342,6 +342,12 @@ SENSITIVITY=${SENSITIVITY}
CHANNELS=${CHANNELS}
## FULL_DISK can be set to configure how the system reacts to a full disk
## 0 = Remove the oldest day's worth of recordings
## 1 = Keep all data and 'stop_core_services.sh'
FULL_DISK=0
## VENV is the virtual environment where the the BirdNET python build is found,
## i.e, VENV is the virtual environment miniforge built for BirdNET.