aboutsummaryrefslogtreecommitdiffstats
path: root/man/man8/zfs-rename.8
diff options
context:
space:
mode:
authorнаб <[email protected]>2022-03-16 19:01:08 +0100
committerBrian Behlendorf <[email protected]>2022-03-28 10:13:14 -0700
commitb61595ff86fb708aa6e22818f36cea3d346f8241 (patch)
treebf0f9d84742d96f4a614650edc9a7e8f5f1ca03a /man/man8/zfs-rename.8
parent4d4fa5215dedaa0e6f53c61a288656362345fa79 (diff)
man: zfs-rename.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/man8/zfs-rename.8')
-rw-r--r--man/man8/zfs-rename.839
1 files changed, 38 insertions, 1 deletions
diff --git a/man/man8/zfs-rename.8 b/man/man8/zfs-rename.8
index 6caee5065..01c580873 100644
--- a/man/man8/zfs-rename.8
+++ b/man/man8/zfs-rename.8
@@ -29,7 +29,7 @@
.\" Copyright 2018 Nexenta Systems, Inc.
.\" Copyright 2019 Joyent, Inc.
.\"
-.Dd September 1, 2020
+.Dd March 16, 2022
.Dt ZFS-RENAME 8
.Os
.
@@ -121,3 +121,40 @@ the file system is not unmounted even if this option is not given.
Recursively rename the snapshots of all descendent datasets.
Snapshots are the only dataset that can be renamed recursively.
.El
+.
+.Sh EXAMPLES
+.\" These are, respectively, examples 10, 15 from zfs.8
+.\" Make sure to update them bidirectionally
+.Ss Example 1 : 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 2 : 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