我如何使用 unison 将文件夹文件与最新修改时间同步?
如何使用 Unison 将文件夹与其文件的最新修改时间同步
示例:
folder_1/file.txt changed at 12:30
folder_2/file.txt changed at 12:35
我想执行 ./unison
给出以下结果:更新文件的最新修改时间,以便更新文件 folder_1/file.txt
将成为与 folder_2/file.txt
相同的文件。
How can I use Unison to sync folders with the latest modification time of its file
Example :
folder_1/file.txt changed at 12:30
folder_2/file.txt changed at 12:35
I wanna execute ./unison
to give me the following result: update file with regards to latest modification time so that the updated file folder_1/file.txt
will became the same file as folder_2/file.txt
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不能。
Unison 的工作原理是将两个文件与其上次同步的版本进行比较。如果两者都发生了变化,并且最终结果不相同,则它们被标记为冲突。虽然在这种情况下可以调用合并程序来解决冲突,但修改时间在整个过程中根本不起任何作用。
从手册中:
You can't.
Unison works by comparing both files with their last synchronized version. If both have changed, and the end result is not identical, they are marked as a conflict. Although in that case a merge program can be invoked to resolve the conflict, the modification time plays no role at all in the whole process.
From the manual: