address review

Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
szaimen 2021-12-08 22:35:09 +01:00
parent 4174e39f2b
commit b0fc3fb953

View file

@ -2,8 +2,16 @@
set -eux
while true; do
# Check for updates and send notification if yes
sudo -u www-data php /var/www/docker-aio/php/src/Cron/cron.php
# Remove dangling images
sudo -u www-data docker image prune -f
sudo -u www-data docker volume prune -f
# Remove dangling volumes
unset DANGLING_VOLUMES
DANGLING_VOLUMES="$(sudo -u www-data docker volume ls --filter dangling=true | awk '{print $2}' | grep -v "nextcloud_aio_\|^VOLUME$")"
mapfile -t DANGLING_VOLUMES <<< "$DANGLING_VOLUMES"
for volume in "${DANGLING_VOLUMES[@]}"; do
sudo -u www-data docker volume rm "$volume"
done
sleep 1d
done