From 0a5f1c0aebf185424289468a9d9ef18d7c8d2302 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Wed, 19 Jul 2023 16:35:13 -0400 Subject: [PATCH] 1.6 log fix --- sonarr/YoutubeSeriesDownloader.service | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/sonarr/YoutubeSeriesDownloader.service b/sonarr/YoutubeSeriesDownloader.service index 30a5e51..0fe489d 100644 --- a/sonarr/YoutubeSeriesDownloader.service +++ b/sonarr/YoutubeSeriesDownloader.service @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.5" +scriptVersion="1.6" ytdlpExtraOpts="--user-agent facebookexternalhit/1.1" scriptName="YoutubeSeriesDownloader" @@ -11,7 +11,9 @@ log () { 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 + if find /config/logs -type f -name "$scriptName.txt" -size +1024k | read; then + echo "" > /config/logs/$scriptName.txt + fi fi if [ ! -f "/config/logs/$scriptName.txt" ]; then @@ -75,22 +77,6 @@ verifyApiAccess () { done } -# auto-clean up log file to reduce space usage -if [ -f "/config/logs/YoutubeSeriesDownloader.txt" ]; then - find /config/logs -type f -name "YoutubeSeriesDownloader.txt" -size +1024k -delete -fi - -if [ ! -f "/config/logs/YoutubeSeriesDownloader.txt" ]; then - touch "/config/logs/YoutubeSeriesDownloader.txt" - chmod 666 "/config/logs/YoutubeSeriesDownloader.txt" -fi -exec &> >(tee -a "/config/logs/YoutubeSeriesDownloader.txt") - -if [ "$arrEventType" == "Test" ]; then - log "Tested Successfully" - exit 0 -fi - CookiesCheck () { # Check for cookies file if [ -f /config/cookies.txt ]; then