From 9e9e991cb64b98e239686aed5fdc361838263bf9 Mon Sep 17 00:00:00 2001 From: Zoey Date: Thu, 23 Feb 2023 07:00:05 +0100 Subject: [PATCH] add sudo Signed-off-by: Zoey --- Containers/mastercontainer/cron.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Containers/mastercontainer/cron.sh b/Containers/mastercontainer/cron.sh index dc9170b1..e8e10be6 100644 --- a/Containers/mastercontainer/cron.sh +++ b/Containers/mastercontainer/cron.sh @@ -48,13 +48,13 @@ while true; do find "/mnt/docker-aio-config/session/" -mindepth 1 -mmin +1440 -delete # Remove nextcloud-aio-domaincheck container - docker container remove nextcloud-aio-domaincheck --force + sudo -u www-data docker container remove nextcloud-aio-domaincheck --force # Remove dangling images sudo -u www-data docker image prune --force # Remove dangling volumes - for volume in $(docker volume ls --quiet --filter dangling=true | grep -E "^[a-z0-9]{64}$"); do docker volume remove "$volume"; done + for volume in $(sudo -u www-data docker volume ls --quiet --filter dangling=true | grep -E "^[a-z0-9]{64}$"); do sudo -u www-data docker volume remove "$volume"; done # Wait 60s so that the whole loop will not be executed again sleep 60