From: Robert Klemme Date: 2007-09-01T18:30:04+09:00 Subject: Re: rsync functionality in Ruby? On 01.09.2007 01:36, Corey Jewett wrote: > >>> On Aug 31, 12:49 pm, Paul van Delst wrote: >>>> Hello, >>>> >>>> I wrote a ruby script to allow me to automatically update a >>>> repository working copy from >>>> an unversioned hierarchy. I use rsync to synchronise the directories >>>> prior to svn >>>> add/delete and commit. Worked great on my test system (linux). >>>> However, because of >>>> security issues, on the system where this script will be used there >>>> is no rsync utility >>>> available. >>>> >>>> So, I was wondering, is there an existing rsync-like ruby solution? >>>> I checked this >>>> newsgroup, rubyforge, raa, etc but couldn't find anything that >>>> replicated rsync >>>> functionality (lots of utilities that use/manage rsync though.) > > You should look at FileUtils::cp_r with the :preserve option. It's not > the same as rsync by any stretch, but it should be fairly similar > assuming you didn't need --delete or --include/--exclude patterns. If > you do need those, then the source of FileUtils is probably a pretty > good place to start rolling your own since it properly does symlinks, > permissions, times, and other metadata. Other options for unidirectional update on system with GNU utils are: - use cp -au - maybe you can also facilitate tar You can build synchronization out of these by invoking then twice, i.e. once for each direction. Other than that it should not be too difficult to implement something on your own using methods in class File. Kind regards robert