forked from Nachtzuster/BirdNET-Pi
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcleanup.sh
More file actions
executable file
·18 lines (15 loc) · 747 Bytes
/
cleanup.sh
File metadata and controls
executable file
·18 lines (15 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash
source /etc/birdnet/birdnet.conf
set -x
cd "${PROCESSED}" || exit 1
empties=($(find ${PROCESSED} -size 57c))
for i in "${empties[@]}";do
rm -f "${i}"
rm -f "${i/.csv/}"
done
if [[ "$(find ${PROCESSED} | wc -l)" -ge 100 ]];then
ls -1t . | tail -n +100 | xargs -r rm -vv
fi
#accumulated_files=$(find $RECS_DIR -path $PROCESSED -prune -o -path $EXTRACTED -prune -o -type f -print | wc -l)
#[ $accumulated_files -ge 10 ] && stop_core_services.sh
#echo "$(date "+%b %e %I:%M:%S") Stopped Core Services -- It looks like analysis stopped. Check raw recordings in $RECS_DIR and check the birdnet_analysis.service and birdnet_server.service \"journalctl -eu birdnet_analysis -u birdnet_server\"" | sudo tee -a /var/log/syslog