Giter Club home page Giter Club logo

Comments (10)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
This bug is still open in version 1.33.

Think of the following test case:
We want to sync the local folder syncme to myserver.org.

The local directory layout is as follows:
/syncme/my spaced dir/some file.txt
/syncme/my spaced dir/some other file.txt

And this is how the server receives it:
/syncme/my spaced dir/              ## an empty folder
/syncme/my/some file.txt            ## our two files will actually be stored 
under this broken up name
/syncme/my/some other file.txt

Original comment by [email protected] on 27 Jun 2010 at 7:10

from lsyncd.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
The bug does not occur on initial sync.

The following happens while monitoring /syncme with lsyncd:
$ cd /syncme
/syncme $ mkdir "my spaced dir"                      ## this will start rsync 
and will
                                                                      ## create "some spaced dir" folder on the destination
/syncmde $ touch "my spaced dir/some file.txt" ## this starts rsync again but 
now the file
                                                                      ## will be safed to "my/some file.txt"

First I thought that the bug is triggered by wrong escaping but since the 
application uses execv for calling rsync there should be no problem.
By calling above like commands the bug is always reproduceable.

Original comment by [email protected] on 27 Jun 2010 at 8:20

from lsyncd.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
Sorry, it works for me.
Maybe this a rsync bug? I'm using 2.6.9

Original comment by [email protected] on 11 Jul 2010 at 8:17

  • Changed state: Wait

from lsyncd.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
I just ran into this issue as well.

I think the problem is that rsync sends command lines to the remote host. In 
particular, the command

 rsync -av '/abc/def ghj/kl mn/' 'host:/abc/def ghj/kl mn/'

does not work (and this is what lsyncd issues). The remote path must be 
explicitly escaped, e.g. as

 rsync -av '/abc/def ghj/kl mn/' 'host:"/abc/def ghj/kl mn/"'

(cf. http://www.samba.org/rsync/FAQ.html#9)

One way to work around this is to pass the option "--protect-args" to rsync.

After adding <option text="--protect-args"/> to the <callopts> section of my 
lsyncd.conf.xml, directories with spaces appear to be synced just fine. Should 
this option be on by default?

Original comment by [email protected] on 8 Aug 2010 at 3:45

from lsyncd.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
it sounds useful, strange enough my rsync does not know this option.
You know at which rsync version this was introduced or removed?
Neither is it included in my rsyncs manpage.

# rsync --protect-args 44 55
rsync: --protect-args: unknown option
rsync error: syntax or usage error (code 1) at main.c(1318) [client=2.6.9]

Original comment by [email protected] on 8 Aug 2010 at 6:59

  • Changed state: New

from lsyncd.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
It looks like this option was added with version 3.0.0.
(http://www.samba.org/ftp/rsync/src/rsync-3.0.0-NEWS)
Sorry, I didn't realize this option was new.

Original comment by [email protected] on 9 Aug 2010 at 6:10

from lsyncd.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
I'm thinking of how to solve this issue most elegantly. I could per default 
probe for rsyncs version, or just add -s (protect-args) per default, and deal 
with people complaining it doesnt work with < 3.0. I guess turning it on per 
default is a useful think, plus a probe and warning if rsync is < 3.0

Original comment by [email protected] on 9 Aug 2010 at 9:21

from lsyncd.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
I suppose the best solution would be to escape file names in lsyncd, so that it 
will also work with all versions of rsync ;-). 

I guess that it would be enough to turn any path of the form 
"hostname:pathname" into "hostname:'pathname'". But I'm not sure how to do this 
reliably, since it would require some parsing of source and target paths. One 
could perhaps use rsync's function parse_hostspec from option.c to do the 
parsing (if licensing allows). But this looks a little fragile as well, as one 
should want to keep in sync with rsync then.

Anyway, I'm happy with protect-args for now.

Original comment by [email protected] on 9 Aug 2010 at 11:53

from lsyncd.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
I'll add -s (protect-args) as default value.

Its better than mangling around with pathnames to get rsync in a behavior I 
think it should have been using as default from get go. Seems the only one 
using a production system old enough to have rsync 2.x is me ;-)

Generally most times I try to not tinker lsyncd too much to the special needs 
of rsync, but be a generall binary calling on event happening daemon.

Original comment by [email protected] on 9 Aug 2010 at 11:58

from lsyncd.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
Version 1.38 now has -s in the default arguments. I suppose this is now thus 
fixed.

Original comment by [email protected] on 7 Sep 2010 at 7:24

  • Changed state: Fixed

from lsyncd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.