From e85c43d075f819445489cb517ed8aa3d30ede636 Mon Sep 17 00:00:00 2001 From: Zoey Date: Wed, 22 Feb 2023 18:03:48 +0100 Subject: [PATCH] Cron: clean nextcloud-aio-domaincheck/tmp volumes Signed-off-by: Zoey --- Containers/mastercontainer/cron.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Containers/mastercontainer/cron.sh b/Containers/mastercontainer/cron.sh index 563b1ef6..82fa4dc7 100644 --- a/Containers/mastercontainer/cron.sh +++ b/Containers/mastercontainer/cron.sh @@ -47,8 +47,14 @@ while true; do # Remove sessions older than 24h find "/mnt/docker-aio-config/session/" -mindepth 1 -mmin +1440 -delete + # Remove nextcloud-aio-domaincheck container + docker container remove nextcloud-aio-domaincheck --force + # Remove dangling images - sudo -u www-data docker image prune -f + sudo -u www-data docker image prune --force + + # Remove dangling volumes + for image in $(docker volume ls --quiet --filter dangling=true | grep -E "^[a-z0-9]{64}$"); do docker volume remove "$image"; done # Wait 60s so that the whole loop will not be executed again sleep 60