Alternatives to programmatically calling the rsync binary a lot

Axel Kittenberger axel77 at gmail.com
Thu Oct 16 11:38:57 GMT 2008


Dear list, I'd like to have your expertise opinion on following issue.

Out of a concrete need we developed an application that will rsync any
changes on a local directory structure to a remove system the moment they
happen using the linux kernel watch feature. This is in our opinion much
more elegant compared to invoking rsync every x seconds/minutes from cron,
or having to use a special filesystem (a FUSEd mirror or even kernel
native). The application is called lsyncd (live syncing demon)
http://code.google.com/p/lsyncd/

For simplicity we just exec()ed the systems installed rsync binary to invoke
rsync for a directory when a change happened in it. Now some users
complained that this strategy involves a lot of forking on a vivid directory
structure. Also we have not yet figured out a developed way how to handle
which error rsync might encounter (what to do on network error, what to do
on other errors) etc.

Now do you think it is feasible to go for another strategy than working at
hands distance by forking? I looked into librsync, in a childish assumption
guessing it would be very same thing rsync uses, but a few reads later its
evident they do not. But the big Beta tag frightens me, also it says its not
wire compatible with rsync > 2, which does not look so cool. The other
alternative would be to directly link with the rsync files (the
possibilities of the GNU world), and call /use its according functions just
like the rysnc main() function would do. What do you think would be smartest
strategy to go for?

Kind regards,
Axel Kittenberger
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the rsync mailing list