v1.6 - logging fixes

This commit is contained in:
RandomNinjaAtk 2023-07-19 18:12:12 +00:00 committed by GitHub
parent cebfe47ba8
commit f0f98b274d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
scriptVersion="1.5" scriptVersion="1.6"
scriptName="QueueCleaner" scriptName="QueueCleaner"
log () { log () {
@ -7,6 +7,22 @@ log () {
echo $m_time" :: $scriptName :: $scriptVersion :: "$1 echo $m_time" :: $scriptName :: $scriptVersion :: "$1
} }
logfileSetup () {
# auto-clean up log file to reduce space usage
if [ -f "/config/logs/$scriptName.txt" ]; then
find /config/logs -type f -name "$scriptName.txt" -size +1024k -delete
fi
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/$scriptName.txt")
verifyConfig () { verifyConfig () {
#### Import Settings #### Import Settings
source /config/extended.conf source /config/extended.conf
@ -22,19 +38,6 @@ verifyConfig () {
fi fi
} }
logfileSetup () {
# auto-clean up log file to reduce space usage
if [ -f "/config/logs/QueueCleaner.txt" ]; then
find /config/logs -type f -name "QueueCleaner.txt" -size +1024k -delete
fi
if [ ! -f "/config/logs/QueueCleaner.txt" ]; then
touch "/config/logs/QueueCleaner.txt"
chmod 666 "/config/logs/QueueCleaner.txt"
fi
exec &> >(tee -a "/config/logs/QueueCleaner.txt")
}
QueueCleanerProcess () { QueueCleanerProcess () {
# Get Arr App information # Get Arr App information
if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then