Jignesh Shah
2009-May-02 18:37 UTC
The --relative option on remote machine to source machine ???
Hi, I read below lines in rsync v3.0.5 for --relative option. if you used this command: rsync -av /foo/bar/baz.c remote:/tmp/ ... this would create a file named baz.c in /tmp/ on the remote machine. If instead you used rsync -avR /foo/bar/baz.c remote:/tmp/ then a file named /tmp/foo/bar/baz.c would be created on the remote machine, preserving its full path It is also possible to limit the amount of path information that is sent as implied directories for each path you specify. With a modern rsync on the sending side (beginning with 2.6.7), you can insert a dot and a slash into the source path, like this: rsync -avR /foo/./bar/baz.c remote:/tmp/ That would create /tmp/bar/baz.c on the remote machine. (note the line in blue) This says we can use relative option only from source to destination. Could any one tell me how could I use relative option from remote machine to source machine like below: rsync -avR remote:/foo/./bar/. /tmp/ I want to sync everything in /foo/bar/ on remote machine to /tmp/bar/ on source machine. Currently this command creates /tmp/foo/bar/ directory. Thanks, Jignesh -------------- next part -------------- HTML attachment scrubbed and removed
Jignesh Shah
2009-May-02 19:01 UTC
The --relative option on remote machine to source machine ???
Sorry guys, I was using rsync 2.6.7 in "rsync -avR remote:/foo/./bar/. /tmp/" command. In rsync v3.0.5 it works as expected. Thanks, Jignesh On Sun, May 3, 2009 at 12:07 AM, Jignesh Shah <jignesh.shah1980@gmail.com>wrote:> Hi, > I read below lines in rsync v3.0.5 for --relative option. > > if you used this command: > rsync -av /foo/bar/baz.c remote:/tmp/ > ... this would create a file named baz.c in /tmp/ on the remote machine. If > instead you used > rsync -avR /foo/bar/baz.c remote:/tmp/ > then a file named /tmp/foo/bar/baz.c would be created on the remote > machine, preserving its full path > > It is also possible to limit the amount of path information that is sent as > implied directories for each path you specify. With a modern rsync on the > sending side (beginning with 2.6.7), you can insert a dot and a slash into > the source path, like this: > rsync -avR /foo/./bar/baz.c remote:/tmp/ > That would create /tmp/bar/baz.c on the remote machine. > > (note the line in blue) This says we can use relative option only from > source to destination. Could any one tell me how could I use relative option > from remote machine to source machine like below: > > rsync -avR remote:/foo/./bar/. /tmp/ > > I want to sync everything in /foo/bar/ on remote machine to /tmp/bar/ on > source machine. Currently this command creates /tmp/foo/bar/ directory. > > Thanks, > Jignesh >-------------- next part -------------- HTML attachment scrubbed and removed