From 47dbaf2c1d6329fdc814a107e0020b5b23e2d237 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Thu, 26 Oct 2023 08:46:09 -0400 Subject: acid: Prune old build logs during startup maintenance Signed-off-by: Malfurious --- acid/acid | 1 + acid/config.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/acid/acid b/acid/acid index c675fa1..49e8e72 100755 --- a/acid/acid +++ b/acid/acid @@ -92,6 +92,7 @@ sleep "$CYCHE_STARTUP_TIME" remove update --force docker system prune --force --all +find /logs -type f | sort -n | head -n "$((CYCHE_LOG_SIZE*-1))" | xargs rm -f starttime=$(now) # monitor source changes diff --git a/acid/config.sh b/acid/config.sh index ff44998..a25531e 100644 --- a/acid/config.sh +++ b/acid/config.sh @@ -10,6 +10,9 @@ CYCHE_JOB_TIME=10 # 10 seconds # Minimum time to wait on daemon startup CYCHE_STARTUP_TIME=60 # 1 minute +# Maximum number of latest build logs to retain during cleanup +CYCHE_LOG_SIZE=100 + # Master list of managed services CYCHE_SERVICES=( # should be a string suitable for `git for-each-ref`. Some -- cgit v1.2.3