v1.7 - logging optimizations
This commit is contained in:
parent
73277d5437
commit
283640634a
1 changed files with 10 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
scriptVersion="1.6"
|
scriptVersion="1.7"
|
||||||
scriptName="AutoArtistAdder"
|
scriptName="AutoArtistAdder"
|
||||||
|
|
||||||
log () {
|
log () {
|
||||||
|
@ -9,16 +9,20 @@ log () {
|
||||||
|
|
||||||
logfileSetup () {
|
logfileSetup () {
|
||||||
# auto-clean up log file to reduce space usage
|
# auto-clean up log file to reduce space usage
|
||||||
if [ -f "/config/logs/AutoArtistAdder.txt" ]; then
|
if [ -f "/config/logs/$scriptName.txt" ]; then
|
||||||
find /config/logs -type f -name "AutoArtistAdder.txt" -size +1024k -delete
|
find /config/logs -type f -name "$scriptName.txt" -size +1024k -delete
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "/config/logs/AutoArtistAdder.txt" ]; then
|
if [ ! -f "/config/logs/$scriptName.txt" ]; then
|
||||||
touch "/config/logs/AutoArtistAdder.txt"
|
touch "/config/logs/$scriptName.txt"
|
||||||
chmod 666 "/config/logs/AutoArtistAdder.txt"
|
chmod 666 "/config/logs/$scriptName.txt"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Create Log, start writing...
|
||||||
|
logfileSetup
|
||||||
|
exec &> >(tee -a "/config/logs/AutoArtistAdder.txt")
|
||||||
|
|
||||||
verifyConfig () {
|
verifyConfig () {
|
||||||
#### Import Settings
|
#### Import Settings
|
||||||
source /config/extended.conf
|
source /config/extended.conf
|
||||||
|
@ -329,9 +333,6 @@ AddTidalArtistToLidarr () {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Loop Script
|
|
||||||
logfileSetup
|
|
||||||
exec &> >(tee -a "/config/logs/AutoArtistAdder.txt")
|
|
||||||
# Loop Script
|
# Loop Script
|
||||||
for (( ; ; )); do
|
for (( ; ; )); do
|
||||||
let i++
|
let i++
|
||||||
|
|
Loading…
Reference in a new issue