ZFS-PRUNE-SNAPSHOTS(1)
β¨ ZFS-PRUNE-SNAPSHOTS π
okay so bestie, welcome to the zfs-prune-snapshots(1) page β a general commands manual entry, no cap, and it's literally about scooping up old ZFS snapshots and yeeting them. Let me walk you through it π«Ά
πΈ NAME πΈ
zfs-prune-snapshots β Remove snapshots from one or more zpools that match given criteria. that's it, that's the whole vibe π
π¦ SYNOPSIS π¦
zfs-prune-snapshots [OPTIONS] <time> [[DATASET1] ...]
like, options first, then the time thing, then as many datasets as your heart desires (or none, she's flexible π)
β DESCRIPTION β
Remove snapshots from one or more zpools that match a criteria given over the command line. yes queen, you hand her the criteria, she hands you a cleaner pool. it's giving spring cleaning but make it zfs π§Ήβ¨
π OPTIONS π
-hβ print this message and exit (the classic "help me help you" move)-nβ dry-run, don't actually delete snapshots π (she'll look at them very seriously but won't touch)-lβ list only mode, just list matching snapshots names without deleting (like dry-run mode with machine-parseable output π₯)-p <prefix>β snapshot prefix string to match-s <suffix>β snapshot suffix string to match-iβ invert matching of prefix and suffix (the "not me matching the opposite" energy π)-qβ quiet, do not printout removed snapshots π€«-Rβ recursively delete, pass'-R'directly to'zfs destroy'-vβ increase verbosity (more talking, more detail, more π)-Vβ print the version number and exit
β° TIMESPEC β°
The first argument denotes how old a snapshot must be for it to be considered for deletion β possible specifiers are:
sβ secondsmβ minuteshβ hoursdβ dayswβ weeksMβ monthsyβ years
watch the case bestie βmis minutes andMis months π they are NOT the same and she will not be forgiving about it
π₯ EXAMPLES π₯
zfs-prune-snapshots 1wβ Remove snapshots older than a week across all zpoolszfs-prune-snapshots -vn 1wβ Same as above, but with increased verbosity and without actually deleting any snapshots (dry-run)zfs-prune-snapshots 3w tank1 tank2/backupβ Remove snapshots older than 3 weeks ontank1andtank2/backup. Note that this script will recurse through all oftank1and all datasets belowtank2/backupzfs-prune-snapshots -p 'autosnap_' 1M zonesβ Remove snapshots older than a month on thezonespool that start with the string"autosnap_"zfs-prune-snapshots -s '_frequent' 2M tankβ Remove snapshots older than two months on thetankpool that end with the string"_frequent"zfs-prune-snapshots -i -p 'autosnap_' 1M zonesβ Remove snapshots older than a month on thezonespool that do not start with the string"autosnap_"
π BUGS π
found one? spill it here: β¨https://github.com/bahamas10/zfs-prune-snapshotsβ© π
π AUTHOR π
Dave Eddy <bahamas10> <dave@daveeddy.com> (https://www.daveeddy.com) β icon behavior honestly π«Ά
π SEE ALSO π
zpool(1M), zfs(1M) β go read those too, iykyk β
π LICENSE π
MIT License β¨
and that's the whole page bestie π this was zfs-prune-snapshots(1) from the General Commands Manual, part of the User Commands corner, dated NOV 2018 β slay, go prune responsibly ππ
π¦ where this page comes from
- alpine 3.24: zfs-prune-snapshots-doc 1.5.0-r0 Β· MIT
- nixos 26.05: zfs-prune-snapshots 1.5.0
- nixpkgs unstable: zfs-prune-snapshots 1.5.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms