aboutsummaryrefslogtreecommitdiffstats
path: root/man
diff options
context:
space:
mode:
authorнаб <[email protected]>2022-03-16 18:48:01 +0100
committerBrian Behlendorf <[email protected]>2022-03-28 10:13:14 -0700
commit3b887e485ccc70b34baf02bd229f1808aa01ef14 (patch)
treef97856a0d6a2f39d5af13364baa805c6a7fe7024 /man
parent9bda775bd952b1863abda57429f9c2044ae078b9 (diff)
man: zfs-destroy.8: import examples from zfs.8
Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13228
Diffstat (limited to 'man')
-rw-r--r--man/man8/zfs-destroy.850
-rw-r--r--man/man8/zfs.83
2 files changed, 51 insertions, 2 deletions
diff --git a/man/man8/zfs-destroy.8 b/man/man8/zfs-destroy.8
index 51d9b7ab8..26926d8dc 100644
--- a/man/man8/zfs-destroy.8
+++ b/man/man8/zfs-destroy.8
@@ -29,7 +29,7 @@
.\" Copyright 2018 Nexenta Systems, Inc.
.\" Copyright 2019 Joyent, Inc.
.\"
-.Dd June 30, 2019
+.Dd March 16, 2022
.Dt ZFS-DESTROY 8
.Os
.
@@ -173,6 +173,54 @@ behavior for mounted file systems in use.
The given bookmark is destroyed.
.El
.
+.Sh EXAMPLES
+.\" These are, respectively, examples 3, 10, 15 from zfs.8
+.\" Make sure to update them bidirectionally
+.Ss Example 1 : No Creating and Destroying Multiple Snapshots
+The following command creates snapshots named
+.Ar yesterday No of Ar pool/home
+and all of its descendent file systems.
+Each snapshot is mounted on demand in the
+.Pa .zfs/snapshot
+directory at the root of its file system.
+The second command destroys the newly created snapshots.
+.Dl # Nm zfs Cm snapshot Fl r Ar pool/home Ns @ Ns Ar yesterday
+.Dl # Nm zfs Cm destroy Fl r Ar pool/home Ns @ Ns Ar yesterday
+.
+.Ss Example 2 : No Promoting a ZFS Clone
+The following commands illustrate how to test out changes to a file system, and
+then replace the original file system with the changed one, using clones, clone
+promotion, and renaming:
+.Bd -literal -compact -offset Ds
+.No # Nm zfs Cm create Ar pool/project/production
+ populate /pool/project/production with data
+.No # Nm zfs Cm snapshot Ar pool/project/production Ns @ Ns Ar today
+.No # Nm zfs Cm clone Ar pool/project/production@today pool/project/beta
+ make changes to /pool/project/beta and test them
+.No # Nm zfs Cm promote Ar pool/project/beta
+.No # Nm zfs Cm rename Ar pool/project/production pool/project/legacy
+.No # Nm zfs Cm rename Ar pool/project/beta pool/project/production
+ once the legacy version is no longer needed, it can be destroyed
+.No # Nm zfs Cm destroy Ar pool/project/legacy
+.Ed
+.
+.Ss Example 3 : No Performing a Rolling Snapshot
+The following example shows how to maintain a history of snapshots with a
+consistent naming scheme.
+To keep a week's worth of snapshots, the user destroys the oldest snapshot,
+renames the remaining snapshots, and then creates a new snapshot, as follows:
+.Bd -literal -compact -offset Ds
+.No # Nm zfs Cm destroy Fl r Ar pool/users@7daysago
+.No # Nm zfs Cm rename Fl r Ar pool/users@6daysago No @ Ns Ar 7daysago
+.No # Nm zfs Cm rename Fl r Ar pool/users@5daysago No @ Ns Ar 6daysago
+.No # Nm zfs Cm rename Fl r Ar pool/users@4daysago No @ Ns Ar 5daysago
+.No # Nm zfs Cm rename Fl r Ar pool/users@3daysago No @ Ns Ar 4daysago
+.No # Nm zfs Cm rename Fl r Ar pool/users@2daysago No @ Ns Ar 3daysago
+.No # Nm zfs Cm rename Fl r Ar pool/users@yesterday No @ Ns Ar 2daysago
+.No # Nm zfs Cm rename Fl r Ar pool/users@today No @ Ns Ar yesterday
+.No # Nm zfs Cm snapshot Fl r Ar pool/users Ns @ Ns Ar today
+.Ed
+.
.Sh SEE ALSO
.Xr zfs-create 8 ,
.Xr zfs-hold 8
diff --git a/man/man8/zfs.8 b/man/man8/zfs.8
index f103278a0..570899121 100644
--- a/man/man8/zfs.8
+++ b/man/man8/zfs.8
@@ -299,7 +299,8 @@ if an error occurs, and
if invalid command line options were specified.
.
.Sh EXAMPLES
-.\" Examples 1, 4, 6, 14, 16 are shared with zfs-set.8.
+.\" Examples 1, 4, 6, 7, 11, 14, 16 are shared with zfs-set.8.
+.\" Examples 3, 10, 15 are shared with zfs-destroy.8.
.\" Examples 5 are shared with zfs-list.8.
.\" Examples 8 are shared with zfs-rollback.8.
.\" Examples 9, 10 are shared with zfs-clone.8.