1.4 - logging fixes
This commit is contained in:
parent
58f810f21d
commit
a9bf7baa3c
1 changed files with 14 additions and 11 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
scriptVersion="1.3"
|
scriptVersion="1.4"
|
||||||
scriptName="AutoExtras"
|
scriptName="AutoExtras"
|
||||||
|
|
||||||
log () {
|
log () {
|
||||||
|
@ -8,18 +8,21 @@ 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/AutoExtras.txt" ]; then
|
if [ -f "/config/logs/$scriptName.txt" ]; then
|
||||||
find /config/logs -type f -name "QueueCleaner.txt" -size +1024k -delete
|
find /config/logs -type f -name "$scriptName.txt" -size +1024k -delete
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "/config/logs/AutoExtras.txt" ]; then
|
if [ ! -f "/config/logs/$scriptName.txt" ]; then
|
||||||
touch "/config/logs/AutoExtras.txt"
|
touch "/config/logs/$scriptName.txt"
|
||||||
chmod 666 "/config/logs/AutoExtras.txt"
|
chmod 666 "/config/logs/$scriptName.txt"
|
||||||
fi
|
fi
|
||||||
exec &> >(tee -a "/config/logs/AutoExtras.txt")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
Loading…
Reference in a new issue