1 hour ago · Tech · hide · 0 comments

Destroy a range of ZFS snapshots with a single command When you have a number of old ZFS snapshots to destroy, it can be useful to see if you can delete a complete range. A range of snapshots can be destroyed with a single command. This is what the man page says: An inclusive range of snapshots may be specified by separating the first and last snapshots with a percent sign. The first and/or last snapshots may be left blank, in which case the filesystem's oldest or newest snapshot will be implied. This requires some careful reading. When omitting the begin or end of the range, it comes down to this: zfs destroy zroot/path/to/set@%snap will destroy all snapshots from the oldest to and including zroot/path/to/set@snap zfs destroy zroot/path/to/set@snap% will destroy all snapshots starting from zroot/path/to/set@snap to and including the newest Destroy old snapshosts When you want to destroy all older snapshots of a data set and only keep the newer ones, just pick the newest snapshot you…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.