rsync to a symlink directory

jw schultz jw at pegasys.ws
Tue Sep 24 07:55:59 EST 2002


On Tue, Sep 24, 2002 at 12:28:02AM -0700, Gwendal Stevanazzi wrote:
> On Mon, 23 Sep 2002, jw schultz wrote:
> > On Mon, Sep 23, 2002 at 06:03:12PM -0700, Gwendal Stevanazzi wrote:
> > >
> > > Now I want to update file1.
> > > If I run the command
> > > rsync -aRz file1 destination:/home/test2/link_dir/sub_dir1
> > > from /home/test1/link_dir/sub_dir1 on source, no problem, the file is
> > > updated.
> > >
> > > If I run the command
> > > rsync -aRz link_dir/sub_dir1/file1 destination:/home/test2/
> > > from /home/test1 on source, the new fs structure on destination is:
> > >
> > > /home/test2/real_dir
> > >                 sub_dir1
> > >                       file1
> > >                       file2
> > >                       ...
> > >                 subdir2
> > >                       ...
> > >
> > > /home/test2/link_dir
> > >                 sub_dir1
> > >                       file1
> > >
> > > The symlink is erase and replace by a 'real' directory.
> > >
> > >
> > > Is it the expected behaviour?
> > >
> > > How could I prevent this kind of things to happen ?
> >
> > It is inferred because you haven't yet traversed the link
> > and since rsync doesn't see a directory it will create one.  Try
> > rsync -aRz link_dir/sub_dir1/file1 destination:/home/test2/./
> > to force the traversal of the link so it is already inside
> > the destination.
> 
> Thanks for your quick answer, but unforunately it didn't work any better.

I'm sorry to hear that.  My only other suggestions are to
sync with the link-destination instead of the link or skip
the -R and specify a more complete path on the destination.

-- 
________________________________________________________________
	J.W. Schultz            Pegasystems Technologies
	email address:		jw at pegasys.ws

		Remember Cernan and Schmitt



More information about the rsync mailing list