查找将由 Time Machine 备份的文件

mba*_*man 9 backup time-machine macos

在备份实际发生之前查看 Time Machine 将备份的内容会很有用。我相信应该可以用mdfind. 是否有一个标准的搜索查询来完成这个?或者直接问Time Machine的方法?

Ded*_*tos 10

在 OS X 10.7 (Lion) 中,您可以使用tmutil. 要将机器的当前状态与最近的备份进行比较,您只需使用以下命令,

tmutil compare
Run Code Online (Sandbox Code Playgroud)

但是您可能希望将输出重定向到一个文件,因为它可能有很多。您可以将比较限制为某些类型的差异(例如,文件大小、文件权限)。它做得更多,但我无法比tmutil手册页本身更简洁地描述细节:

compare [-@esmugtdrvEX] [-D depth] [snapshot_path | path1 path2]
       Perform a backup diff.

       If no arguments are provided, tmutil will compare the computer to
       the latest snapshot. If a snapshot path is provided as the sole
       argument, tmutil will compare the computer to the specified snap-
       shot. If two path arguments are provided, tmutil will compare
       those two items to each other.  tmutil will attempt to inform you
       when you have asked it to do something that doesn't make sense or
       isn't supported.

       The compare verb allows you to specify what properties to com-
       pare. If you specify no property options, it is assumed that you
       want to compare a basic set of metadata. This default property
       set is equivalent to the -smugt option set. Specifying any prop-
       erty option overrides the default set.

       Options:
           -a    compare all suppored metadata
           -@    compare extended attributes
           -e    compare ACLs
           -s    compare sizes
           -m    compare file modes
           -u    compare UIDs
           -g    compare GIDs
           -t    compare modification times
           -d    compare file data forks
           -r    ignore specified root paths and compare descendents
                 instead
           -D    limit traversal depth to depth levels from the begin-
                 ning of iteration
           -E    don't take exclusions into account when comparing items
                 inside volumes
           -v    enable verbose mode (enables reporting of all identical
                 items, which is noisy)
           -X    print output in XML property list format
Run Code Online (Sandbox Code Playgroud)


bmi*_*ike 6

提到另一个答案tmutil compare是要求 OS X 模拟下一个备份事件并检查自上次备份以来哪些文件和/或元数据发生了变化的规范方法。但是,有一个非常有用的二进制文件tmdiagnose,我似乎没有在 SuperUser 上提到它,它用于诊断 Time Machine 的问题,它还可以让您详细了解下一次备份的配置、系统排除路径、用户排除路径以及对所有先前备份和快照事件使用的规则。

看看里面hostname -s的两个.tmdiagnostic.zip文件configuration.txt还有exclusions.plist文本文件,以确定哪些文件和路径和被排除在外。


Dan*_*eck 0

1:从Time Machine备份卷上的文件夹名称中解析上次备份时间。如果可能,请使用“最新”链接指向的链接。忽略那些带有“.progress”扩展名的内容(现在不在 Mac 上,所以我可以稍微休息一下)

2 和 3:读取属性列表并将它们用作排除文件(如果可能),或者简单地从这些路径和“grep -v $excluded”创建正则表达式。