v1.1 log cleanup to match rename
This commit is contained in:
parent
8a41dcbe53
commit
bc8b8a5089
1 changed files with 8 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
scriptVersion="1.0"
|
scriptVersion="1.1"
|
||||||
arrEventType="$radarr_eventtype"
|
arrEventType="$radarr_eventtype"
|
||||||
arrItemId=$radarr_movie_id
|
arrItemId=$radarr_movie_id
|
||||||
tmdbApiKey="3b7751e3179f796565d88fdb2fcdf426"
|
tmdbApiKey="3b7751e3179f796565d88fdb2fcdf426"
|
||||||
|
@ -37,19 +37,19 @@ if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# auto-clean up log file to reduce space usage
|
# auto-clean up log file to reduce space usage
|
||||||
if [ -f "/config/logs/MovieExtras.txt" ]; then
|
if [ -f "/config/logs/Extras.txt" ]; then
|
||||||
find /config/logs -type f -name "MovieExtras.txt" -size +1024k -delete
|
find /config/logs -type f -name "Extras.txt" -size +1024k -delete
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "/config/logs/MovieExtras.txt" ]; then
|
if [ ! -f "/config/logs/Extras.txt" ]; then
|
||||||
touch "/config/logs/MovieExtras.txt"
|
touch "/config/logs/Extras.txt"
|
||||||
chmod 777 "/config/logs/MovieExtras.txt"
|
chmod 777 "/config/logs/Extras.txt"
|
||||||
fi
|
fi
|
||||||
exec &> >(tee -a "/config/logs/MovieExtras.txt")
|
exec &> >(tee -a "/config/logs/Extras.txt")
|
||||||
|
|
||||||
log () {
|
log () {
|
||||||
m_time=`date "+%F %T"`
|
m_time=`date "+%F %T"`
|
||||||
echo $m_time" :: MovieExtras :: $scriptVersion :: "$1
|
echo $m_time" :: Extras :: $scriptVersion :: "$1
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$arrEventType" == "Test" ]; then
|
if [ "$arrEventType" == "Test" ]; then
|
||||||
|
|
Loading…
Reference in a new issue