Skip to content
This repository was archived by the owner on Aug 17, 2025. It is now read-only.

Commit eb86fad

Browse files
committed
In certain situations trying to recover from stalled analysis we can end up
with low / no disk space and be unable to "escape." In the event of a backlog, the loop in birdnet_analysis.sh runs continuously, which means analyzed files do not get moved, which means in turn extract_new_birdsounds.sh cannot create mp3 extractions and move the processed files again, which would allow them to be cleaned up by the cron jobs. This patch is the obvious fix, i.e. to just limit the maximum amount of files birdnet_analysis.sh can process to 20. This should be a good trade off given the small overhead of listing files etc before the main loop begins - note that for the "normal" case of no backlog, birdnet_analysis usually exits after a single analysis anyway.
1 parent c85fa1e commit eb86fad

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scripts/birdnet_analysis.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env -S --default-signal=PIPE bash
22
# Runs BirdNET-Lite
33
#set -x
44
source /etc/birdnet/birdnet.conf
@@ -52,6 +52,7 @@ fi
5252
get_files() {
5353
files=($( find ${1} -maxdepth 1 -name '*wav' ! -size 0\
5454
| sort \
55+
| head -n 20 \
5556
| awk -F "/" '{print $NF}' ))
5657
[ -n "${files[1]}" ] && echo "Files loaded"
5758
}

0 commit comments

Comments
 (0)