mickours / lsyncd

Automatically exported from code.google.com/p/lsyncd
GNU General Public License v2.0
0 stars 0 forks source link

Know when parent directory rsync will be completed #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Maybe I am mistaken on the use of %r in configuration but lsyncd seems 
extremely inefficient when there are too many directories involved (such as 
svn).

For example, if I have a directory structure similar to this:

var
`-- www
    |-- images
    |  `-- pic.jpg
    |-- css
       `-- main.css

If I modify pic.jpg then within the delay time I modify main.css is it possible 
to make lsyncd just rsync on /var/www instead of once for /var/www/images and 
/var/www/css?

Original issue reported on code.google.com by webP...@gmail.com on 20 Jul 2010 at 10:05

GoogleCodeExporter commented 9 years ago
Or even at a minimum if it is possible to group at a parent level. So if I were 
to "touch" a file at /var/www it would know that rsync -r would include the 
files mentioned above.

Original comment by webP...@gmail.com on 20 Jul 2010 at 10:07

GoogleCodeExporter commented 9 years ago
I doubt calling rsyncd recursively on a parent directory is more efficent than 
calling it in -d mode for the 2 subdirectories events happened. rsync also does 
nothing magically different than working this 2 directories through after each 
other AND then having to do look through even more subdirs, which isn't 
necessary.

%r is for startup only when the whole directory tree is synced to the target.

Original comment by axk...@gmail.com on 20 Jul 2010 at 10:55

GoogleCodeExporter commented 9 years ago
I don't have any hard evidence that it is slower than a normal rsync with -r 
but I would guess that it could send incremental changes in one fail swoop 
instead of sending incremental changes per directory. Meaning, it's not asking 
the client node for a difference list for every directory which has a change. 
More is processed on each node before attempting to rsync.

I am working with many thousands of directories, something like 15400 are in 
inotify's watch list.

On a side note is -d required in callopts?

I am using -lptgoD%r for callopts. Is it possible that the -t is what is 
slowing things down?

Original comment by webP...@gmail.com on 20 Jul 2010 at 11:06

GoogleCodeExporter commented 9 years ago
I have to see evidence that asking for a difference list of hugh tree is in any 
way more efficient than asking two times for a difference list for 2 specific 
directories.

The man page explains options:
"%r will be replaced with 'r' when rsycnd is supposed to work recursive (on 
startup of lsyncd) or 'd' on normal operations."

15400 seems to be on the lower end what people told me already they are using 
it for ;-) There are limits due to the technologies used, it just takes a 
while. If you can make it faster, please show me the code and the test cases 
for it, if they are coded well I will gladly add them to the repository.

Original comment by axk...@gmail.com on 20 Jul 2010 at 11:42

GoogleCodeExporter commented 9 years ago

Original comment by axk...@gmail.com on 21 Jul 2010 at 7:18