more responsive birdnet_analysis.service
This commit is contained in:
@@ -115,11 +115,11 @@ for h in "${SCAN_DIRS[@]}";do
|
|||||||
|
|
||||||
# If there are already 20 extracted entries for a given species
|
# If there are already 20 extracted entries for a given species
|
||||||
# for today, remove the oldest file and create the new one.
|
# for today, remove the oldest file and create the new one.
|
||||||
if [[ "$(find ${NEWSPECIES_BYDATE} | wc -l)" -ge 21 ]];then
|
# if [[ "$(find ${NEWSPECIES_BYDATE} | wc -l)" -ge 21 ]];then
|
||||||
echo "20 ${SPECIES}s, already! Removing the oldest by-date and making a new one"
|
# echo "20 ${SPECIES}s, already! Removing the oldest by-date and making a new one"
|
||||||
cd ${NEWSPECIES_BYDATE} || exit 1
|
# cd ${NEWSPECIES_BYDATE} || exit 1
|
||||||
ls -1t . | tail -n +21 | xargs -r rm -vv
|
# ls -1t . | tail -n +21 | xargs -r rm -vv
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
echo "Extracting audio . . . "
|
echo "Extracting audio . . . "
|
||||||
# If the above tests have passed, then the extraction happens.
|
# If the above tests have passed, then the extraction happens.
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Description=BirdNET Analysis
|
|||||||
Restart=always
|
Restart=always
|
||||||
RuntimeMaxSec=10800
|
RuntimeMaxSec=10800
|
||||||
Type=simple
|
Type=simple
|
||||||
RestartSec=3
|
RestartSec=1
|
||||||
User=${USER}
|
User=${USER}
|
||||||
ExecStart=/usr/local/bin/birdnet_analysis.sh
|
ExecStart=/usr/local/bin/birdnet_analysis.sh
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ After=network-online.target ${SYSTEMD_MOUNT}
|
|||||||
[Service]
|
[Service]
|
||||||
Restart=always
|
Restart=always
|
||||||
Type=simple
|
Type=simple
|
||||||
RestartSec=3
|
RestartSec=1
|
||||||
User=${BIRDNET_USER}
|
User=${BIRDNET_USER}
|
||||||
ExecStart=/usr/local/bin/birdnet_analysis.sh
|
ExecStart=/usr/local/bin/birdnet_analysis.sh
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user