From c0b3fc2a0221b48cc7ec9d402bb3bddc6e0d815d Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Thu, 20 Oct 2016 19:44:55 +0200 Subject: [PATCH] Clear more logs #1137 --- lgsm/functions/logs.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lgsm/functions/logs.sh b/lgsm/functions/logs.sh index 4bf9ab903..32ad0deae 100644 --- a/lgsm/functions/logs.sh +++ b/lgsm/functions/logs.sh @@ -29,6 +29,9 @@ fi # Log manager will start the cleanup if it finds logs older than "${logdays}" if [ $(find "${scriptlogdir}"/ -type f -mtime +"${logdays}"|wc -l) -ne "0" ]; then fn_print_dots "Starting" + # Set common logs directories + commonlogs="${systemdir}/logs" + commonsourcelogs="${systemdir}/*/logs" # Set addon logs directories sourcemodlogdir="${systemdir}/addons/sourcemod/logs" ulxlogdir="${systemdir}/data/ulx_logs" @@ -57,6 +60,17 @@ if [ $(find "${scriptlogdir}"/ -type f -mtime +"${logdays}"|wc -l) -ne "0" ]; th consolecount=$(find "${consolelogdir}"/ -type f -mtime +"${logdays}"|wc -l) find "${consolelogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; fi + # Common logfiles + if [ -d ${commonlogs} ]; then + find "${commonlogs}"/ -type f -mtime +"${logdays}"| tee >> "${scriptlog}" + smcount=$(find "${commonlogs}"/ -type f -mtime +"${logdays}"|wc -l) + find "${commonlogs}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; + fi + if [ -d ${commonsourcelogs} ]; then + find "${commonsourcelogs}"/* -type f -mtime +"${logdays}"| tee >> "${scriptlog}" + smcount=$(find "${commonsourcelogs}"/* -type f -mtime +"${logdays}"|wc -l) + find "${commonsourcelogs}"/* -mtime +"${logdays}" -type f -exec rm -f {} \; + fi # Source addons logfiles if [ "${engine}" == "source" ]; then # SourceMod logfiles