fixed bug in cronjob script files: volume prune was in dangling-images and system prune in dangling volumes. Raised volume prune cronjob to every 12 hours #4

Merged
adellam merged 1 commits from marco.procaccini/ansible-role-docker:master into master 2025-07-11 11:04:21 +02:00
3 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
# "system" prune, because pruning images only leaves a lot of garbage around
docker volume prune --force > /var/log/docker-volume-prune.log 2>&1
docker system prune --force >> /var/log/docker-system-prune.log 2>&1
exit 0

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
# "system" prune, because pruning images only leaves a lot of garbage around
docker system prune --force > /var/log/docker-prune.log 2>&1
docker volume prune --force > /var/log/docker-volumes-prune.log 2>&1
exit 0

View File

@ -120,7 +120,8 @@
cron:
name: Prune docker volumes
cron_file: docker-prune-volumes
special_time: daily
minute: "0"
hours: "*/12"
user: root
state: present
job: "/usr/local/sbin/docker-prune-dangling-volumes"
@ -130,7 +131,8 @@
cron:
name: Prune docker volumes
cron_file: docker-prune-volumes
special_time: daily
minute: "0"
hours: "*/12"
user: root
state: absent
job: "/usr/local/sbin/docker-prune-dangling-volumes"