Merge pull request 'crontab prune volume e sistemi migliorati' (!8) from marco.procaccini/ansible-role-docker:master into master

Reviewed-on: #8
This commit is contained in:
Marco Procaccini 2025-10-27 18:04:33 +01:00
commit 5332af4e70
2 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,9 @@
#!/usr/bin/env bash
LOG_FILE="/var/log/docker-system-prune.log"
echo "===== $(date '+%Y-%m-%d %H:%M:%S') =====" >> "$LOG_FILE"
# "system" prune, because pruning images only leaves a lot of garbage around
docker system prune --force >> /var/log/docker-system-prune.log 2>&1
docker system prune --force >> "$LOG_FILE" 2>&1
echo "" >> "$LOG_FILE"
exit 0

View File

@ -1,5 +1,9 @@
#!/usr/bin/env bash
LOG_FILE="/var/log/docker-volumes-prune.log"
echo "===== $(date '+%Y-%m-%d %H:%M:%S') =====" >> "$LOG_FILE"
# "system" prune, because pruning images only leaves a lot of garbage around
docker volume prune --force > /var/log/docker-volumes-prune.log 2>&1
docker volume prune --force >> "$LOG_FILE" 2>&1
echo "" >> "$LOG_FILE"
exit 0