Skip site navigation (1)Skip section navigation (2)

  
 
  

home | help
ZSD(1)		       User Contributed Perl Documentation		  ZSD(1)

NAME
     zsd - Quickly destroys a specified amount of ZFS snapshots

SYNOPSIS
     zsd  [--gather-snapshots-sorted-by-name] [--fork-and-forget] [--not-really]
     --keep  number-of-snapshots  --destroy  number-of-snapshots   [--use-range]
     [--verbose][--verbose] dataset

     zsd  [--gather-snapshots-sorted-by-name] [--fork-and-forget] --keep number-
     of-snapshots [--not-really] [--use-range] [--verbose][--verbose] dataset

     zsd [--gather-snapshots-sorted-by-name] [--fork-and-forget] --destroy  num-
     ber-of-snapshots	 [--not-really]   [--use-range]   [--verbose][--verbose]
     dataset

     zsd --help

DESCRIPTION
     zsd (ZFS snapshot destroyer) is a zfs(8) wrapper to  destroy  a  number  of
     snapshots on a given dataset using a more convenient interface.

     The number of snapshots to destroy can be specified directly, or indirectly
     by  specifying  the  number of snapshots that should be kept. Snapshots are
     destroyed in the (by default chronological) order they are  listed  by  zfs
     list.

     zsd  goes	nicely	with  zogftw's zogftw_snapshot_successfully_sent_hook to
     grow a certain number of snapshots on new backup datasets while keeping the
     number of snapshots on old backup datasets constant.

     zsd is mainly developed and tested using OpenZFS on ElectroBSD, but is  ex-
     pected to work on other platforms as well.

OPTIONS
     --destroy	number-of-snapshots  If  enough snapshots are available, destroy
     snapshots until reaching either the specified number or the number of snap-
     shots to keep specified with --keep. If --keep isn't used, one snapshot  is
     kept so receival of incremental snapshots continues to work.

     --gather-snapshots-sorted-by-name	Let  zfs(8) list the available snapshots
     sorted by name which is a lot faster (on FreeBSD derivates) as  less  meta-
     data  has	to be read. This should only be used if the order in which snap-
     shots are destroyed doesn't matter or if  sorting	the  snapshots	by  name
     keeps the chronological order.

     --fork-and-forget	Fork  a  process  for  each snapshots that should be de-
     stroyed and don't check if the operation is successful.  If  the  ZFS  pool
     feature  async_destroy is unsupported or disabled, this is generally faster
     than destroying the snapshots one-by-one.	The downside is that it requires
     more memory and that errors are ignored.

     --keep number-of-snapshots When used without --destroy and if enough  snap-
     shots  are  available,  snapshots	are  destroyed until the given number of
     snapshots is reached. If the option is used  together  with  --destroy,  it
     specifies the number of snapshots that should be kept.

     --not-really  Show  how  many  snapshots  would  be destroyed if the option
     wasn't being used, but don't actually destroy them.

     --use-range When there is more than one snapshot to destroy, use  a  single
     zfs  command  with a snapshot range instead of destroying each snapshot one
     by one.

     --verbose Be more verbose. When specified once, the destroyed snapshots are
     shown. When specified twice, the kept snapshots are shown as well.

     All options can be shortened as long as there are no ambiguities.

EXAMPLES
     The following examples are independent and assume a  dataset  tank/blafasel
     with 100 snapshots.

     zsd --destroy 10 tank/blafasel Destroys 10 snapshots.

     zsd  --destroy  100 tank/blafasel Destroys 99 snapshots as not using --keep
     implies that at least one snapshot should be kept.

     zsd --destroy 100 --keep 0 tank/blafasel Destroys all the 100 snapshots  as
     no snapshot has to be kept.

     zsd -d 100 -k 0 tank/blafasel Same as the above, but requires less typing.

     zsd --destroy 100 --keep 40 tank/blafasel Destroys 60 snapshots as 40 snap-
     shots have to be kept.

     zsd  --destroy 10 --keep 40 tank/blafasel Destroys 10 snapshots, keeping 90
     as 40 is only the lower limit.

     zsd -d 20 -k 20 -n tank/blafasel Shows how  many  snapshots  would  be  de-
     stroyed without -n.

     zsd --destroy 100 --keep 200 tank/blafasel Destroys no snapshot as the num-
     ber  of snapshots to keep is above the number of snapshots available on the
     dataset.

     zsd --keep 10 tank/blafasel Destroys 90 snapshots as  not	using  --destroy
     implies that all the snapshots above the limit should be destroyed.

SEE ALSO
     zfs(8) zogftw(8) zpool-features(7)

AUTHOR
     Fabian Keil <fk@fabiankeil.de>

perl v5.36.3			   2024-07-31				  ZSD(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=zsd&sektion=8&manpath=FreeBSD+Ports+15.1.quarterly>

home | help