[BBLISA] Live Sync / Backup / Sync without crawling

Tom Metro tmetro+bblisa at vl.com
Mon Nov 3 17:36:38 EST 2008


John Orthoefer wrote:
> Tony Rudie wrote:
>> Rsync should be fine.  And searching for a specific entry in a 
>> directory should be way faster than looking at every entry to see if 
>> it needs copying.  Right?
> 
> If your filesystem stores directory entries in something other than an 
> unsorted list, yes it should be faster.
> ...
> But if your filesystem still keeps you directories in something that is 
> unhashed, then you might as well just let rsync do it's job, you are 
> only saving a stat call at that point...

I'm not sure I see the relevance of hashed directories with respect to 
the OP's question.

If you let rsync operate in its usual fashion, then it needs to scan the 
directory hierarchy, and look at the file system metadata for each file, 
comparing it with the remote file, and if a difference is found, perform 
a more detailed block comparison.

The OP was seeking to replace that scan with an event driven model using 
inotify or an equivalent service hooked into the OS's kernel that would 
fire events when a change occurred in the area of interest.


> When I first saw this message, my answer was use rsync with
> --from-file...

So where does the list of files come from that you put into the file 
pointed at by --files-from?

Sure, you can use something like:

inotifywait -q -r -m ... /path | perl -pe ... | rsync --files-from=- ...

but it requires more than just rsync.

  -Tom

-- 
Tom Metro
Venture Logic, Newton, MA, USA
"Enterprise solutions through open source."
Professional Profile: http://tmetro.venturelogic.com/




More information about the bblisa mailing list