v1.6 - logging fixes

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

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
scriptVersion="1.5" scriptVersion="1.6"
scriptName="Recyclarr" scriptName="Recyclarr"
log () { log () {
@ -9,17 +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/Recyclarr.txt" ]; then if [ -f "/config/logs/$scriptName.txt" ]; then
find /config/logs -type f -name "Recyclarr.txt" -size +1024k -delete find /config/logs -type f -name "$scriptName.txt" -size +1024k -delete
fi fi
if [ ! -f "/config/logs/Recyclarr.txt" ]; then if [ ! -f "/config/logs/$scriptName.txt" ]; then
touch "/config/logs/Recyclarr.txt" touch "/config/logs/$scriptName.txt"
chmod 666 "/config/logs/Recyclarr.txt" chmod 666 "/config/logs/$scriptName.txt"
fi fi
exec &> >(tee -a "/config/logs/Recyclarr.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