gpt4 book ai didi

zfs - 访问 "diff only"ZFS 快照

转载 作者:行者123 更新时间:2023-12-01 04:52:35 31 4
gpt4 key购买 nike

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

提前致谢

格雷格

最佳答案

尽管安德鲁的建议 zfs send是使用差异快照的正确方法,如果您只想查看差异并在您自己的脚本中或在没有 ZFS 支持的其他平台上使用它们,还有 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.

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

手册页的示例输出:
# 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切换到递归地比较所有子数据集。

关于zfs - 访问 "diff only"ZFS 快照,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35623511/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com