From 7ab0d50abf9b7e0dc5dd02d9553a554fab514a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Zolt=C3=A1n?= Date: Mon, 17 Mar 2025 16:00:25 +0100 Subject: [PATCH] rotate_logs now rotates non-empty logs even if the service isn't running. --- .metadata | Bin 15326 -> 15326 bytes tools/rotate_logs | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.metadata b/.metadata index 1e80ec981f3088f54699bec15b71ded55948659b..48dffc25289f27a82eb4cf1cd5d45b6689cc2331 100644 GIT binary patch delta 96 zcmcatey@B(GaFCO)0628Kw$E`on`VxbJ58Gl46^8vFR{#H(A^O%dEBfJ6T^&Z1M#b sp~(w`**42_X$tUULnZHo7Kly$D62NPK#_BD0|)zLU2X2oQ>8o=0eh7n&;S4c delta 93 zcmcatey@B(GaHY=3FbJ58Gl46^8vFR}Lym|zYDVXG?G}%B-bn*oj up~(w`**42_X$r8Y@tsPWyg*cRa=Zw~ # 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