From 05acdc27a2023143cf5ed7b478516abb05d36dd3 Mon Sep 17 00:00:00 2001
From: Alexandre <44178713+alexbelgium@users.noreply.github.com>
Date: Wed, 5 Feb 2025 15:28:11 +0100
Subject: [PATCH] Use correct birdsongs_dir
---
.../rootfs/custom-services.d/30-monitoring.sh | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/birdnet-pi/rootfs/custom-services.d/30-monitoring.sh b/birdnet-pi/rootfs/custom-services.d/30-monitoring.sh
index 2990bda5c..6d0a9d87d 100755
--- a/birdnet-pi/rootfs/custom-services.d/30-monitoring.sh
+++ b/birdnet-pi/rootfs/custom-services.d/30-monitoring.sh
@@ -29,13 +29,10 @@ log_green "Starting service: throttlerecording"
########################################
# Define Directories, Files, and Constants
########################################
-INGEST_DIR="${RECS_DIR/StreamData:-$HOME/BirdSongs/StreamData}"
-INGEST_DIR=$(readlink -f "$INGEST_DIR")
-if [ /tmp/StreamData ]; then
- INGEST_DIR="/tmp/StreamData"
-fi
+INGEST_DIR="$(readlink -f "$HOME/BirdSongs/StreamData")"
ANALYZING_NOW_FILE="$INGEST_DIR/analyzing_now.txt"
touch "$ANALYZING_NOW_FILE"
+BIRDSONGS_DIR="$(readlink -f "$HOME/BirdSongs/Extracted/By_Date")"
# Ensure directories and set permissions
mkdir -p "$INGEST_DIR" || { log_red "Failed to create directory: $INGEST_DIR"; exit 1; }
@@ -89,7 +86,7 @@ apprisealert() {
local notification="Issue: $issue_message"
notification+="$stopped_service"
notification+="
System: ${SITE_NAME:-$(hostname)}"
- notification+="
Available disk space: $(df -h "$HOME/BirdSongs" | awk 'NR==2 {print $4}')"
+ notification+="
Available disk space: $(df -h "$BIRDSONGS_DIR" | awk 'NR==2 {print $4}')"
notification+="
----Last log lines----"
notification+="
$(timeout 15 cat /proc/1/fd/1 | head -n 5)"
notification+="
----------------------"
@@ -114,7 +111,7 @@ apprisealert_recovery() {
local TITLE="BirdNET-Pi System Recovered"
local notification="All monitored services are back to normal.
"
notification+="System: ${SITE_NAME:-$(hostname)}
"
- notification+="Available disk space: $(df -h "$HOME/BirdSongs" | awk 'NR==2 {print $4}')"
+ notification+="Available disk space: $(df -h "$BIRDSONGS_DIR" | awk 'NR==2 {print $4}')"
if [[ -f "$HOME/BirdNET-Pi/birdnet/bin/apprise" && -s "$HOME/BirdNET-Pi/apprise.txt" ]]; then
"$HOME/BirdNET-Pi/birdnet/bin/apprise" -vv -t "$TITLE" -b "$notification" \
@@ -130,7 +127,7 @@ apprisealert_recovery() {
check_disk_space() {
local current_usage
- current_usage=$(df -h "$HOME/BirdSongs" | awk 'NR==2 {print $5}' | sed 's/%//')
+ current_usage=$(df -h "$BIRDSONGS_DIR" | awk 'NR==2 {print $5}' | sed 's/%//')
if (( current_usage >= DISK_USAGE_THRESHOLD )); then
log_red "$(date) INFO: Disk usage is at ${current_usage}% (CRITICAL!)"