rsync to a symlink directory
Sriram Ramkrishna
sramkris at ichips.intel.com
Tue Sep 24 16:21:00 EST 2002
I've always tried just appending a trailing slash to the destination
that always worked for me.
sri
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:
> > >
> > > Here is the structure of my servers :
> > >
> > > Source :
> > >
> > > /home/test1/link_dir
> > > sub_dir1
> > > file1
> > > file2
> > > ...
> > > sub_dir2
> > > ...
> > >
> > > Destination:
> > >
> > > /home/test2/real_dir
> > > sub_dir1
> > > file1
> > > file2
> > > ...
> > > subdir2
> > > ...
> > > /home/test2/link_dir@ -> real_dir
> > >
> > >
> > >
> > > 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.
>
> Here is the output of the command with -v and --stats if it helps:
>
> building file list ... done
> link_dir/
> link_dir/sub_dir1/
> link_dir/sub_dir1/file1
> rsync[17349] (server receiver) heap statistics:
> arena: 123544 (bytes from sbrk)
> rsync[17347] (sender) heap statistics:
> arena: 336536 (bytes from sbrk)
> ordblks: 2 (chunks not in use)
> smblks: 0
> hblks: 0 (chunks from mmap)
> hblkhd: 0 (bytes from mmap)
> usmblks: 0
> fsmblks: 0
> uordblks: 326880 (bytes used)
> fordblks: 9656 (bytes free)
> keepcost: 5560 (bytes in releasable chunk)
>
> Number of files: 3
> Number of files transferred: 1
> Total file size: 266240 bytes
> Total transferred file size: 266240 bytes
> Literal data: 266240 bytes
> Matched data: 0 bytes
> File list size: 96
> Total bytes written: 266517
> Total bytes read: 36
>
> wrote 266517 bytes read 36 bytes 533106.00 bytes/sec
> total size is 266240 speedup is 1.00
>
>
> This test was done with rsync version 2.5.6cvs protocol version 26
> but I don't think it matters ...
>
>
> --
> Gwen
>
> --
> To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
> Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html
More information about the rsync
mailing list