v1.7 - logging optimizations

This commit is contained in:
RandomNinjaAtk 2023-07-19 14:40:28 +00:00 committed by GitHub
parent 73277d5437
commit 283640634a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
#!/usr/bin/with-contenv bash
scriptVersion="1.6"
scriptVersion="1.7"
scriptName="AutoArtistAdder"
log () {
@ -9,16 +9,20 @@ log () {
logfileSetup () {
# auto-clean up log file to reduce space usage
if [ -f "/config/logs/AutoArtistAdder.txt" ]; then
find /config/logs -type f -name "AutoArtistAdder.txt" -size +1024k -delete
if [ -f "/config/logs/$scriptName.txt" ]; then
find /config/logs -type f -name "$scriptName.txt" -size +1024k -delete
fi
if [ ! -f "/config/logs/AutoArtistAdder.txt" ]; then
touch "/config/logs/AutoArtistAdder.txt"
chmod 666 "/config/logs/AutoArtistAdder.txt"
if [ ! -f "/config/logs/$scriptName.txt" ]; then
touch "/config/logs/$scriptName.txt"
chmod 666 "/config/logs/$scriptName.txt"
fi
}
# Create Log, start writing...
logfileSetup
exec &> >(tee -a "/config/logs/AutoArtistAdder.txt")
verifyConfig () {
#### Import Settings
source /config/extended.conf
@ -329,9 +333,6 @@ AddTidalArtistToLidarr () {
}
# Loop Script
logfileSetup
exec &> >(tee -a "/config/logs/AutoArtistAdder.txt")
# Loop Script
for (( ; ; )); do
let i++