From bcae74061121cdc272e0b4ecd0fe699bbfd06093 Mon Sep 17 00:00:00 2001 From: Philipp Woelfel Date: Sat, 15 Nov 2025 23:50:05 -0700 Subject: [PATCH] Improved documentation --- README.md | 21 ++++++++++----------- checkSnapshots.sh | 3 ++- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a219997..a645fc4 100644 --- a/README.md +++ b/README.md @@ -18,17 +18,16 @@ Script to check zfs snapshot counts and age of oldest most recent snapshot. Spec ## Options -```bash --d, --dataset Dataset to check (required, repeat for multiple) --e, --exclude Exclude dataset (repeat for multiple) --p, --prefix Snapshot prefix (default: zrepl_) --f, --format Timestamp format (see [below](#timestamp-formats--f)) --s, --max-snapshots Max snapshots per dataset --m, --max-age Max age (e.g., 31s, 17m, 24h) --r, --recursive Include sub-datasets --v, --verbose Show detailed table --n, --err-for-no-snapshots Error if no snapshots found -``` +- `-d, --dataset `: Dataset to check (required; can be repeated for multiple) +- `-p, --prefix `: Snapshot prefix (default: zrepl_) +- `-f, --format `: Timestamp format (see [below](#timestamp-formats--f)) +- `-s, --max-snapshots `: Max snapshots per dataset +- `-m, --max-age `: Max age (e.g., 31s, 17m, 24h) +- `-r, --recursive`: Include sub-datasets +- `-e, --exclude `: Exclude dataset (can be repeated for multiple) +- `-v, --verbose`: Show detailed table +- `-n, --err-for-no-snapshots`: Error if no snapshots found +- `-h, --help`: Show help message ## Timestamp Formats (`-f`) diff --git a/checkSnapshots.sh b/checkSnapshots.sh index e4f1908..403da06 100755 --- a/checkSnapshots.sh +++ b/checkSnapshots.sh @@ -17,7 +17,7 @@ ERR_FOR_NO_SNAPSHOTS=false FORMAT="" usage() { - echo "Usage: $0 -d|--dataset [-d|--dataset ...] [-p|--prefix ] [-f|--format ] [-m ] [-s|--max-snapshots ] [-e|--exclude ] [-r|--recursive] [-v|--verbose] [-n|--err-for-no-snapshots]" + echo "Usage: $0 -d|--dataset [-d|--dataset ...] [-p|--prefix ] [-f|--format ] [-m ] [-s|--max-snapshots ] [-e|--exclude ] [-r|--recursive] [-v|--verbose] [-n|--err-for-no-snapshots] [-h|--help]" echo " -d, --dataset ZFS dataset to check (can be specified multiple times)" echo " -e, --exclude Dataset to exclude (can be specified multiple times)" echo " -p, --prefix Snapshot prefix (default: zrepl_)" @@ -27,6 +27,7 @@ usage() { echo " -r, --recursive Include all sub-datasets of specified datasets" echo " -v, --verbose Print per-dataset snapshot count and age" echo " -n, --err-for-no-snapshots Return error if any dataset has no snapshots" + echo " -h, --help Show this help message" exit 1 }