v1.6 - logging fixes
This commit is contained in:
parent
cebfe47ba8
commit
f0f98b274d
1 changed files with 17 additions and 14 deletions
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
scriptVersion="1.5"
|
||||
scriptVersion="1.6"
|
||||
scriptName="QueueCleaner"
|
||||
|
||||
log () {
|
||||
|
@ -7,6 +7,22 @@ log () {
|
|||
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 () {
|
||||
#### Import Settings
|
||||
source /config/extended.conf
|
||||
|
@ -22,19 +38,6 @@ verifyConfig () {
|
|||
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 () {
|
||||
# Get Arr App information
|
||||
if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then
|
||||
|
|
Loading…
Reference in a new issue