mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
Merge pull request #2051 from nextcloud/improve-docker-cleanup
Cron: remove nextcloud-aio-domaincheck if stopped
This commit is contained in:
commit
d8de7e0765
1 changed files with 6 additions and 1 deletions
|
|
@ -47,8 +47,13 @@ while true; do
|
||||||
# Remove sessions older than 24h
|
# Remove sessions older than 24h
|
||||||
find "/mnt/docker-aio-config/session/" -mindepth 1 -mmin +1440 -delete
|
find "/mnt/docker-aio-config/session/" -mindepth 1 -mmin +1440 -delete
|
||||||
|
|
||||||
|
# Remove nextcloud-aio-domaincheck container
|
||||||
|
if sudo -u www-data docker ps --format "{{.Names}}" --filter "status=exited" | grep -q "^nextcloud-aio-domaincheck$"; then
|
||||||
|
sudo -u www-data docker container remove nextcloud-aio-domaincheck
|
||||||
|
fi
|
||||||
|
|
||||||
# Remove dangling images
|
# Remove dangling images
|
||||||
sudo -u www-data docker image prune -f
|
sudo -u www-data docker image prune --force
|
||||||
|
|
||||||
# Wait 60s so that the whole loop will not be executed again
|
# Wait 60s so that the whole loop will not be executed again
|
||||||
sleep 60
|
sleep 60
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue