From 8cfcce8c9c765a6b82c4182132eceeed57d869ba Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Fri, 4 Nov 2022 11:21:52 -0400 Subject: [PATCH] 1.0.054 - New logging to log file process --- root/scripts/{video.sh => Video.sh} | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) rename root/scripts/{video.sh => Video.sh} (99%) diff --git a/root/scripts/video.sh b/root/scripts/Video.sh similarity index 99% rename from root/scripts/video.sh rename to root/scripts/Video.sh index 0a73369..080be67 100644 --- a/root/scripts/video.sh +++ b/root/scripts/Video.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.053" +scriptVersion="1.0.054" if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" @@ -44,6 +44,15 @@ verifyApiAccess () { done } +# auto-clean up log file to reduce space usage +if [ -f "/config/logs/Video.txt" ]; then + find /config/logs -type f -name "Video.txt" -size +5000k -delete + sleep 0.01 +fi +exec &> >(tee -a "/config/logs/Video.txt") +touch "/config/logs/Video.txt" +chmod 666 "/config/logs/Video.txt" + log "-----------------------------------------------------------------------------" log "|~) _ ._ _| _ ._ _ |\ |o._ o _ |~|_|_|" log "|~\(_|| |(_|(_)| | || \||| |_|(_||~| | |<"