通过管道将 rsync 输出传输到文件
是否可以将输出(原始数据,无日志记录)通过管道传输到 rsync 文件,并可能将其保存到 bsdiff 中?我发现 rsnapshot 由于缺乏配置和愚蠢的语法(缩进,wtf?)而非常令人恼火,而 rdiff 则有点不稳定。
我有一个可行的解决方案,我将所有数据同步,制作一个 tar.gz 存档,并使用 bsdiff 在两个 tar.gz 存档之间生成补丁。但这对于巨大的负载来说是相当 CPU 密集型的,并且非常磁盘密集型的,因为您每次都必须制作整个存档。
总结一下: - 进行初始rsync - 将其与以前的文件进行 bsdiff - 以一种易于恢复的方式存档差异
当我写这篇文章时,我刚刚有了一个关于 lvm-snapshot 的想法,有人知道我应该如何继续吗?
Is it possible to pipe the output (raw data, no logging) to a file of rsync, and maybe save this to a bsdiff? I find rsnapshot to be highly irritating with the lack of configuration and stupid syntax (indenting, wtf?) and rdiff to be a little unstable.
I have a working solution where i rsync all the data over, make a tar.gz-archive of it and bsdiff to generate a patch between two tar.gz-archives. But this is pretty CPU intensive on huge loads and very disk intensive, as you have to make the entire archive every time.
To sum it up:
- Make the initial rsync
- bsdiff it against the previous files
- Archive the diff in a way to make it easy to recover
When i wrote this i just got an idea with lvm-snapshot, any takers on how I should go forth with that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
rsync(1)
在联系远程系统时可以轻松使用不同的 shell;-e ssh
是默认设置,但您可以编写一个包装程序来启动ssh
并保存转发到ssh
的所有内容的副本代码>.我想到的一些伪代码:
请仔细检查
pipe(2)
、dup2(2)
和close(2)< /code> 在实现此之前调用;我相信我正确连接了描述符并关闭了每个进程中未使用的描述符,但这有点微妙。
我不知道您将生成的文件应用到远程端点的 tarball 有多容易,但我希望这不是您所困扰的部分。
rsync(1)
can use a different shell easily when contacting remote systems;-e ssh
is the default, but you could write a wrapper program that startsssh
and saves a copy of all the content that you forward along tossh
.Some pseudo-code for what I'm thinking of:
Please double-check the
pipe(2)
,dup2(2)
, andclose(2)
calls before implementing this; I believe I hooked up the descriptors properly and closed the unused descriptors in each process, but this is a little subtle.I don't know how easy it will be for you to apply the resulting file to your remote endpoint's tarball, but I hope that's not the part you're stuck on.