changeset 13773:00c2a08cf1bb

2399 zfs manual page does not document use of "zfs diff" Reviewed by: Joshua M. Clulow <josh@sysmgr.org> Reviewed by: Matt Ahrens <mahrens@delphix.com> Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com> Reviewed by: Dan McDonald <danmcd@nexenta.com> Approved by: Robert Mustacchi <rm@joyent.com>
author Richard Lowe <richlowe@richlowe.net>
date Thu, 16 Aug 2012 13:08:53 -0400
parents 2579580ac955
children 80b84226b49f
files usr/src/man/man1m/zfs.1m
diffstat 1 files changed, 95 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/man/man1m/zfs.1m	Thu Aug 16 15:11:17 2012 -0400
+++ b/usr/src/man/man1m/zfs.1m	Thu Aug 16 13:08:53 2012 -0400
@@ -7,7 +7,7 @@
 .\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with
 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
 .\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
-.TH ZFS 1M "28 Jul 2011"
+.TH ZFS 1M "Aug 16, 2012"
 .SH NAME
 zfs \- configures ZFS file systems
 .SH SYNOPSIS
@@ -219,6 +219,10 @@
 \fBzfs\fR \fBrelease\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR...
 .fi
 
+.LP
+.nf
+\fBzfs\fR \fBdiff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot|filesystem\fR
+
 .SH DESCRIPTION
 .sp
 .LP
@@ -1758,7 +1762,7 @@
 .sp
 Multiple snapshots
 (or ranges of snapshots) of the same filesystem or volume may be specified
-in a comma-separated list of snapshots.  
+in a comma-separated list of snapshots.
 Only the snapshot's short name (the
 part after the \fB@\fR) should be specified when using a range or
 comma-separated list to identify multiple snapshots.
@@ -1831,8 +1835,6 @@
 behavior for mounted file systems in use.
 .RE
 
-.RE
-
 .sp
 .ne 2
 .na
@@ -3057,6 +3059,9 @@
                                 ability in the origin file system
 create           subcommand     Must also have the 'mount' ability
 destroy          subcommand     Must also have the 'mount' ability
+diff             subcommand     Allows lookup of paths within a dataset
+                                given an object number, and the ability to
+                                create snapshots necessary to 'zfs diff'.
 mount            subcommand     Allows mount/umount of ZFS datasets
 promote          subcommand     Must also have the 'mount'
                                 and 'promote' ability in the origin file system
@@ -3267,6 +3272,68 @@
 descendent file systems.
 .RE
 
+.sp
+.ne 2
+.na
+\fBzfs diff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot|filesystem\fR
+.ad
+.sp .6
+.RS 4n
+Display the difference between a snapshot of a given filesystem and another
+snapshot of that filesystem from a later time or the current contents of the
+filesystem.  The first column is a character indicating the type of change,
+the other columns indicate pathname, new pathname (in case of rename), change
+in link count, and optionally file type and/or change time.
+
+The types of change are:
+.in +2
+.nf
+-       The path has been removed
++       The path has been created
+M       The path has been modified
+R       The path has been renamed
+.fi
+.in -2
+.sp
+.ne 2
+.na
+\fB-F\fR
+.ad
+.sp .6
+.RS 4n
+Display an indication of the type of file, in a manner similar to the \fB-F\fR
+option of \fBls\fR(1).
+.in +2
+.nf
+B       Block device
+C       Character device
+/       Directory
+>       Door
+|       Named pipe
+@       Symbolic link
+P       Event port
+=       Socket
+F       Regular file
+.fi
+.in -2
+.RE
+.sp
+.ne 2
+.na
+\fB-H\fR
+.ad
+.sp .6
+.RS 4n
+Give more parseable tab-separated output, without header lines and without arrows.
+.RE
+.sp
+.ne 2
+.na
+\fB-t\fR
+.ad
+.sp .6
+.RS 4n
+Display the path's inode change time as the first column of output.
 .RE
 
 .SH EXAMPLES
@@ -3650,7 +3717,7 @@
 .sp
 .in +2
 .nf
-# \fB# zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home\fR
+# \fBzfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home\fR
 .fi
 .in -2
 .sp
@@ -3706,7 +3773,7 @@
 .sp
 .in +2
 .nf
-# \fB# zfs allow staff create,mount tank/users\fR
+# \fBzfs allow staff create,mount tank/users\fR
 # \fBzfs allow -c destroy tank/users\fR
 # \fBzfs allow tank/users\fR
 -------------------------------------------------------------
@@ -3795,6 +3862,28 @@
 .in -2
 .sp
 
+.LP
+\fBExample 23\fR Showing the differences between a snapshot and a ZFS Dataset
+.sp
+.LP
+The following example shows how to see what has changed between a prior
+snapshot of a ZFS Dataset and its current state.  The \fB-F\fR option is used
+to indicate type information for the files affected.
+
+.sp
+.in +2
+.nf
+# zfs diff -F tank/test@before tank/test
+M       /       /tank/test/
+M       F       /tank/test/linked      (+1)
+R       F       /tank/test/oldname -> /tank/test/newname
+-       F       /tank/test/deleted
++       F       /tank/test/created
+M       F       /tank/test/modified
+.fi
+.in -2
+.sp
+
 .SH EXIT STATUS
 .sp
 .LP