parent
e88e1b12f1
commit
16f624cf21
1 changed files with 13 additions and 17 deletions
|
@ -1,25 +1,21 @@
|
||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
scriptVersion="1.0.5"
|
scriptVersion="1.0.6"
|
||||||
|
scriptName="QueueCleaner"
|
||||||
|
|
||||||
######## Settings
|
#### Import Settings
|
||||||
scriptInterval="15m"
|
source /config/extended.conf
|
||||||
|
|
||||||
######## Package dependencies installation
|
|
||||||
PackageInstallation () {
|
|
||||||
if [ ! -f "/config/logs/QueueCleaner.txt" ]; then
|
|
||||||
echo "Installing Required Packages..."
|
|
||||||
apk add -U --update --no-cache curl jq python3-dev py3-pip &>/dev/null
|
|
||||||
pip install --upgrade --no-cache-dir -U yq &>/dev/null
|
|
||||||
echo "Done"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Logging output function
|
|
||||||
log () {
|
log () {
|
||||||
m_time=`date "+%F %T"`
|
m_time=`date "+%F %T"`
|
||||||
echo $m_time" :: QueueCleaner :: $scriptVersion :: "$1
|
echo $m_time" :: $scriptName :: $scriptVersion :: "$1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ "$enableQueueCleaner" != "true" ]; then
|
||||||
|
log "Script is not enabled, enable by setting enableQueueCleaner to \"true\" by modifying the \"/config/extended.conf\" config file..."
|
||||||
|
log "Sleeping (infinity)"
|
||||||
|
sleep infinity
|
||||||
|
fi
|
||||||
|
|
||||||
# auto-clean up log file to reduce space usage
|
# auto-clean up log file to reduce space usage
|
||||||
if [ -f "/config/logs/QueueCleaner.txt" ]; then
|
if [ -f "/config/logs/QueueCleaner.txt" ]; then
|
||||||
find /config/logs -type f -name "QueueCleaner.txt" -size +1024k -delete
|
find /config/logs -type f -name "QueueCleaner.txt" -size +1024k -delete
|
||||||
|
@ -127,8 +123,8 @@ if [ "$arrName" == "Sonarr" ] || [ "$arrName" == "Radarr" ] || [ "$arrName" == "
|
||||||
let i++
|
let i++
|
||||||
log "Starting..."
|
log "Starting..."
|
||||||
QueueCleanerProcess
|
QueueCleanerProcess
|
||||||
log "Sleeping $scriptInterval..."
|
log "Sleeping 15m..."
|
||||||
sleep $scriptInterval
|
sleep 15m
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
log "ERROR :: Arr app not detected, exiting..."
|
log "ERROR :: Arr app not detected, exiting..."
|
||||||
|
|
Loading…
Reference in a new issue