rsync 与增量传输基于时间戳进行同步
我使用 rsync 命令进行增量传输。 rsync 的作用是只传输更改。现在我有两台机器,每台机器都有两个文件夹,其内容会不时更改。我想要的是有一个脚本,在执行时用较新的内容替换较旧的内容。与新的相比,旧的时间戳具有较低的时间戳。 rsync 可以做到这一点吗?
I use rsync command to delta transfers. What rsync does is that it would transfer only changes. Now I have two machines each of which have two folders whose contents get changed from time to time. What I want is to have a script that when executed replaces the contents of the side that is older with the one that is newer. The older one is the one that has lower timestamp when compared with the newer one. Is rsync capable of doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
-u
选项(不会用较新的时间戳覆盖文件)并运行rsync
两次:Use the
-u
option (which won't overwrite a file with a newer timestamp) and runrsync
twice:重复项:
同步-of-a-directory-in-2-systems-使用-rsync
Duplicates:
synchronization-of-a-directory-in-2-systems-using-rsync