rsync 操作在文件级别是原子的吗? [英] Are rsync operations atomic at file level?

查看:18
本文介绍了rsync 操作在文件级别是原子的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm trying to figure out how if rsyncing files is atomic. I couldn't find any confirmation about it. Due to rsync being able to send only deltas, I was under the impression that it also updates only parts of the live files.

On the other hang DJB recommends rsync for synchronising live .cdb files and I've found this post ( http://lists.samba.org/archive/rsync/2002-April/002210.html ) which both would imply that the new file is created, then moved over to the proper location.

Can someone point me at an official source confirming one or the other?

解决方案

Rsync creates a new temporary file which will contain blocks from the local (receiving) copy and whatever blocks it requires from the sending copy. When done the temporary file is moved into place replacing the original.

Full details are here;

http://rsync.samba.org/how-rsync-works.html

这篇关于rsync 操作在文件级别是原子的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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