diff --git a/.metadata b/.metadata index 1e80ec9..48dffc2 100644 Binary files a/.metadata and b/.metadata differ diff --git a/tools/rotate_logs b/tools/rotate_logs index c51f145..33bd92c 100755 --- a/tools/rotate_logs +++ b/tools/rotate_logs @@ -10,6 +10,8 @@ # Author: Kovács Zoltán # Kovács Zoltán # License: GNU/GPL v3+ (https://www.gnu.org/licenses/gpl-3.0.en.html) +# 2025-03-17 v1.2 +# mod: rotates non-empty logs even if the service isn't running. # 2024-08-24 v1.1 # new: docker-compose v2 compatibility - tested with Ubuntu 24.04 LTS. # 2023-06-18 v1.0 @@ -98,10 +100,6 @@ CONFFILE="$CONFDIR/.${SCRFILE%.*}.conf" STATEFILE="$CONFDIR/.${SCRFILE%.*}.state" LOGDIR="${PAR_LOGDIR:-$BASE_DIR/$LOGDIR}" -# Doesn't rotate logs for stopped services. -[[ -z "$(cd "$BASE_DIR"; "$DOCKER_COMPOSE" $commandstring ps --services --filter "status=running")" ]] \ -&& exit 0 - # Locates the worker script. WORKERSCRIPT="$SCRPATH/copytruncate" [[ ! -x "$WORKERSCRIPT" ]] && WORKERSCRIPT="$(which copytruncate)" @@ -116,6 +114,7 @@ $LOGDIR/*.log { missingok daily rotate 30 + notifempty # Must be consistent with prerotate script's settings! dateext dateyesterday @@ -143,6 +142,7 @@ $LOGDIR/web/*.log { missingok daily rotate 60 + notifempty # Must be consistent with prerotate script's settings! dateext dateyesterday