From 37052d13772d67f21a7f6e80e266469234a79653 Mon Sep 17 00:00:00 2001 From: Alaa Ali Date: Sun, 5 Apr 2026 02:18:27 -0500 Subject: [PATCH] Clarify -b and -p option interaction (#277) --- README.md | 6 ++++-- dockcheck.sh | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 77a9134..c54acd4 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Example: dockcheck.sh -y -x 10 -d 10 -e nextcloud,heimdall Options: -a|y Automatic updates, without interaction. --b N Enable image backups and sets number of days to keep from pruning. +-b N Enable image backups and sets number of days to keep from pruning. Ignores -p auto-prune. -B List currently backed up images, then exit. -c D Exports metrics as prom file for the prometheus node_exporter. Provide the collector textfile directory. -d N Only update to new images that are N+ days old. Lists too recent with +prefix and age. 2xSlower. @@ -81,7 +81,7 @@ Options: -m Monochrome mode, no printf colour codes and hides progress bar. -M Prints custom releasenote urls as markdown (requires template support). -n No updates, only checking availability. --p Auto-Prune dangling images after update. +-p Auto-Prune dangling images after update. Ignored when -b is used. -r Allow checking/updating images created by `docker run`, containers need to be recreated manually. -R Skip container recreation after pulling images. -s Include stopped containers, returns to stopped state after recreation. @@ -295,6 +295,8 @@ The backed up images will be removed if they're older than *BackupForDays* value If configured for eg. 7 days, force earlier cleaning by just passing a lower number of days, eg. `-b 2` to clean everything older than 2 days. Backed up images will not be removed if neither `-b` flag nor `BackupForDays` config variable is set. +When backups are enabled, the `-p` auto-prune option is ignored to preserve backed up images. + Use the capital option `-B` to list currently backed up images. Or list all images with `docker images`. To manually remove any backed up images, do `docker rmi dockcheck/homer:2025-10-26_1132_latest`. diff --git a/dockcheck.sh b/dockcheck.sh index 5dca4c3..fb618d4 100755 --- a/dockcheck.sh +++ b/dockcheck.sh @@ -34,7 +34,7 @@ Help() { echo echo "Options:" echo "-a|y Automatic updates, without interaction." - echo "-b N Enable image backups and sets number of days to keep from pruning." + echo "-b N Enable image backups and sets number of days to keep from pruning. Ignores -p auto-prune." echo "-B List currently backed up images, then exit." echo "-c D Exports metrics as prom file for the prometheus node_exporter. Provide the collector textfile directory." echo "-d N Only update to new images that are N+ days old. Lists too recent with +prefix and age. 2xSlower." @@ -48,7 +48,7 @@ Help() { echo "-m Monochrome mode, no printf colour codes and hides progress bar." echo "-M Prints custom releasenote urls as markdown (requires template support)." echo "-n No updates; only checking availability without interaction." - echo "-p Auto-prune dangling images after update." + echo "-p Auto-prune dangling images after update. Ignored when -b is used." echo "-r Allow checking/updating images created by 'docker run', containers need to be recreated manually." echo "-R Skip container recreation after pulling images." echo "-s Include stopped containers, returns to stopped state after recreation."