Improved documentation
This commit is contained in:
parent
5106197dc6
commit
bcae740611
21
README.md
21
README.md
@ -18,17 +18,16 @@ Script to check zfs snapshot counts and age of oldest most recent snapshot. Spec
|
|||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
```bash
|
- `-d, --dataset <dataset>`: Dataset to check (required; can be repeated for multiple)
|
||||||
-d, --dataset <dataset> Dataset to check (required, repeat for multiple)
|
- `-p, --prefix <prefix>`: Snapshot prefix (default: zrepl_)
|
||||||
-e, --exclude <dataset> Exclude dataset (repeat for multiple)
|
- `-f, --format <format>`: Timestamp format (see [below](#timestamp-formats--f))
|
||||||
-p, --prefix <prefix> Snapshot prefix (default: zrepl_)
|
- `-s, --max-snapshots <num>`: Max snapshots per dataset
|
||||||
-f, --format <format> Timestamp format (see [below](#timestamp-formats--f))
|
- `-m, --max-age <duration>`: Max age (e.g., 31s, 17m, 24h)
|
||||||
-s, --max-snapshots <num> Max snapshots per dataset
|
- `-r, --recursive`: Include sub-datasets
|
||||||
-m, --max-age <duration> Max age (e.g., 31s, 17m, 24h)
|
- `-e, --exclude <dataset>`: Exclude dataset (can be repeated for multiple)
|
||||||
-r, --recursive Include sub-datasets
|
- `-v, --verbose`: Show detailed table
|
||||||
-v, --verbose Show detailed table
|
- `-n, --err-for-no-snapshots`: Error if no snapshots found
|
||||||
-n, --err-for-no-snapshots Error if no snapshots found
|
- `-h, --help`: Show help message
|
||||||
```
|
|
||||||
|
|
||||||
## Timestamp Formats (`-f`)
|
## Timestamp Formats (`-f`)
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ ERR_FOR_NO_SNAPSHOTS=false
|
|||||||
FORMAT=""
|
FORMAT=""
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 -d|--dataset <dataset> [-d|--dataset <dataset>...] [-p|--prefix <prefix>] [-f|--format <format>] [-m <duration>] [-s|--max-snapshots <num>] [-e|--exclude <dataset>] [-r|--recursive] [-v|--verbose] [-n|--err-for-no-snapshots]"
|
echo "Usage: $0 -d|--dataset <dataset> [-d|--dataset <dataset>...] [-p|--prefix <prefix>] [-f|--format <format>] [-m <duration>] [-s|--max-snapshots <num>] [-e|--exclude <dataset>] [-r|--recursive] [-v|--verbose] [-n|--err-for-no-snapshots] [-h|--help]"
|
||||||
echo " -d, --dataset ZFS dataset to check (can be specified multiple times)"
|
echo " -d, --dataset ZFS dataset to check (can be specified multiple times)"
|
||||||
echo " -e, --exclude Dataset to exclude (can be specified multiple times)"
|
echo " -e, --exclude Dataset to exclude (can be specified multiple times)"
|
||||||
echo " -p, --prefix Snapshot prefix (default: zrepl_)"
|
echo " -p, --prefix Snapshot prefix (default: zrepl_)"
|
||||||
@ -27,6 +27,7 @@ usage() {
|
|||||||
echo " -r, --recursive Include all sub-datasets of specified datasets"
|
echo " -r, --recursive Include all sub-datasets of specified datasets"
|
||||||
echo " -v, --verbose Print per-dataset snapshot count and age"
|
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 " -n, --err-for-no-snapshots Return error if any dataset has no snapshots"
|
||||||
|
echo " -h, --help Show this help message"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user