访问“仅diff" ZFS快照 [英] Accessing "diff only" ZFS snapshot

查看:157
本文介绍了访问“仅diff" ZFS快照的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有办法挂载仅包含特定于快照的文件的虚拟分区?我知道隐藏的zfs目录,但其中包含快照时的所有文件. 我的目标是使差异备份更快...

Is there a way to mount a virtual partition containing only the files specific to a snapshot? I know about the hidden zfs directory but it contains all files at the snapshot time. My goal is to make diff backup faster...

预先感谢

greg

推荐答案

尽管安德鲁(Andrew)对zfs send的建议是使用差异快照的正确方法,但如果您只是想查看差异和在您自己的脚本中或在没有ZFS支持的其他平台上使用它们,还有zfs diff:

Although Andrew's suggestion of zfs send is the right way to work with differential snapshots, if you just want to see the differences and work with them in your own scripts or on other platforms without ZFS support, there also is zfs diff:

zfs diff [-FHt] snapshot snapshot|filesystem

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:
  -       The path has been removed
  +       The path has been created
  M       The path has been modified
  R       The path has been renamed

-F
    Display an indication of the type of file, in a manner
    similar to the -F option of ls(1).
      B       Block device
      C       Character device
      /       Directory
      >       Door
      |       Named pipe
      @       Symbolic link
      P       Event port
      =       Socket
      F       Regular file
-H
    Give more parsable tab-separated output, without header
    lines and without arrows.
-t
    Display the path's inode change time as the first column of
    output.

请注意,两个数据集的顺序必须是按时间顺序排列的.您可以解析结果列表,并且仅使用您感兴趣的那些文件名.

Note that the order of the two datasets must be chronological. You could parse the resulting list and only work with those filenames you are interested in.

手册页中的示例输出:

# 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

此外,如果您使用Oracle Solaris 11.3,则还具有-r开关以递归方式比较所有子数据集.

Also, if you use Oracle Solaris 11.3, you also have the -r switch to recursively diff all children datasets.

这篇关于访问“仅diff" ZFS快照的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆