Add zfs.sync.snapshot_rename

Only the single snapshot rename is provided.
The recursive or more complex rename can be scripted.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Andriy Gapon <avg@FreeBSD.org>
Closes #13802
This commit is contained in:
Andriy Gapon
2022-09-02 23:31:19 +03:00
committed by GitHub
parent 7bb707ffaf
commit ee9f3bca55
7 changed files with 133 additions and 10 deletions
+13
View File
@@ -424,6 +424,19 @@ To enable taking snapshots from ZCP scripts, the pool must be upgraded.
.It Ar dataset Pq string
Name of snapshot to create.
.El
.It Fn zfs.sync.rename_snapshot dataset oldsnapname newsnapname
Rename a snapshot of a filesystem or a volume.
Returns 0 if the snapshot was successfully renamed,
and a nonzero error code otherwise.
.Pp
.Bl -tag -compact -width "newbookmark (string)"
.It Ar dataset Pq string
Name of the snapshot's parent dataset.
.It Ar oldsnapname Pq string
Original name of the snapshot.
.It Ar newsnapname Pq string
New name of the snapshot.
.El
.It Fn zfs.sync.bookmark source newbookmark
Create a bookmark of an existing source snapshot or bookmark.
Returns 0 if the new bookmark was successfully created,