Hacker News new | ask | show | jobs
by Ygor 4631 days ago
The main problem with the standard rsync utility is the protocol. Check out the Rsync Protocol section of this document:

"A well-designed communications protocol has a number of characteristics."

<list of characteristics>

"Rsync's protocol has none of these good characteristics."

...

"It unfortunately makes the protocol extremely difficult to document, debug or extend. Each version of the protocol will have subtle differences on the wire that can only be anticipated by knowing the exact protocol version."

This is why it is very hard to implement a client program that can communicate with the standard rsync deamon on a server. You can always use the rsync program itself to communicate with the server, but this is not always an option. If it is - it can get ugly. On windows, you need cygwin or similar to run rsync.exe, which can complicate the deployment of your desktop app or shell extension.

An easy rsync client API would be useful if you were building an app that can store files on an rsync server, because the rsync utility and the rsync algorithm are great ways to efficiently syncronize files.

2 comments

On windows, you need cygwin or similar to run rsync.exe, which can complicate the deployment of your desktop app or shell extension.

I tried deploying updates to a (pre-existing already deployed) website to a Windows-server machine using rsync once.

The site which running fine in the first place instantly stopped working, because rsync didn't merely copy the files over, but it completely reset the existing ACLs and permissions on all the files. The result was that the webserver no longer had permission to access the website's files. It was repeatable for every sync.

Needless to say, I found it less than optimal.

What about librsync (as mentioned in the comments here)?
from the librsync page: librsync is not wire-compatible with rsync 2.x, and is not likely to be in the future

http://librsync.sourceforge.net/

Does librsync speak the rsync protocol or just create deltas?
librsync is a library for building rsync workalikes. It is not compatible with rsync itself.

librsync and the rdiff binary that wraps it can create a signature from a destination file, create a patch from a signature and a source file, and can apply a patch to a destination file. And that's about it. librsync doesn't concern itself with the networking. That's up to you.

rdiff is a thin wrapper around librsync. librsync can easily do anything rdiff can do, without having to fork a new process. You might wish the rsync executable were built this way, but it is not.