1.0.269 - Limit log file to 5MB size

pull/139/head
RandomNinjaAtk 2 years ago committed by GitHub
parent 90e4392c8c
commit c948bce12b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
#!/usr/bin/env bash
scriptVersion="1.0.268"
scriptVersion="1.0.269"
if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
if [ "$lidarrUrlBase" == "null" ]; then
@ -38,8 +38,9 @@ log () {
echo $m_time" :: Extended Audio :: "$1
}
# auto-clean up log file to reduce space usage
if [ -f "/config/logs/Audio.txt" ]; then
rm "/config/logs/Audio.txt"
find /config/logs -type f -name "Audio.txt" -size +5000k -delete
sleep 0.01
fi
exec &> >(tee -a "/config/logs/Audio.txt")

Loading…
Cancel
Save