Files
AvianVisitors/scripts/cleanup.sh
T
Patrick McGuire 620bc69824 fixed typo
2021-10-13 17:53:12 -04:00

14 lines
293 B
Bash
Executable File

#!/usr/bin/env bash
source /etc/birdnet/birdnet.conf
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