Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
welcome:zfs:small_tricks [2021/08/27 15:45] 127.0.0.1 modification externe |
welcome:zfs:small_tricks [2023/05/29 17:31] (Version actuelle) arnaud [Destroy many snapshots] |
||
---|---|---|---|
Ligne 15: | Ligne 15: | ||
You may find something like this a little simpler | You may find something like this a little simpler | ||
- | zfs list -t snapshot -o name | grep ^tank@Auto | tac | tail -n +16 | xargs -n 1 zfs destroy -r | + | zfs list -t snapshot -o name | grep '^tank@Auto' |
output the list of snapshot (names only) with zfs list -t snaphot -o name | output the list of snapshot (names only) with zfs list -t snaphot -o name | ||
Ligne 27: | Ligne 27: | ||
or sort in reverse order of creation | or sort in reverse order of creation | ||
- | zfs list -t snapshot -o name -S creation | grep ^tank@Auto | tail -n +16 | xargs -n 1 zfs destroy -vr | + | zfs list -t snapshot -o name -S creation | grep '^tank@Auto' |
Test it with ...|xargs -n 1 echo </ | Test it with ...|xargs -n 1 echo </ | ||
+ | |||
+ | <note tip>the argument of the " | ||
+ | ....use '' | ||
====== Find snapshots ====== | ====== Find snapshots ====== |