On Sun, 2008-06-22 at 22:26 +0000, Corey wrote:
> I've got an existing linux box, with a particular directory that needs
> to be mirrored onto another server, into a different base path on that
> server - i.e.:
> 
> server1:/var/lib/bar/ to server2:/backupdir/var/lib/bar/
> 
> Now, server1:/var/lib/bar/ contains hundreds of files which are each
> symlink'd to one of a few files in the same directory:
> 
> /var/lib/bar/base_file1
> /var/lib/bar/base_file2
> /var/lib/bar/base_file3
> /var/lib/bar/foo -> /var/lib/bar/base_file1
> /var/lib/bar/bar -> /var/lib/bar/base_file3
> /var/lib/bar/blah -> /var/lib/bar/base_file2
> /var/lib/bar/goober -> /var/lib/bar/base_file2
> 
> The first problem is that these symlinks (on server1) are all using
> the fully-qualified path - which is causing me problems because
> /var/lib/bar/ doesn't exist on server2, but rather in
> /backupdir/var/lib/bar/ ...
> 
> Is there a way of forcing rsync to link these relatively rather than
> fully-qualitive? So that (for an exampe) the rsync from
> server1:/var/lib/bar/foo to server2 ends up like:
> 
> server2:/backupdir/var/lib/bar/foo -> 
> server2:/backupdir/var/lib/bar/base_file1
> 
> rather than (what it's currently doing):
> 
> server2:/backupdir/var/lib/bar/foo -> server2:/var/lib/bar/base_file1
> 
> (...which results in a broken link)

No, rsync does not support this kind of symlink rewriting, unless you
want to hack the "munge symlinks" code to prepend /backupdir instead
of /rsyncd-munged/ and remove the check that the prepended directory
doesn't exist.

In this situation, I would just change the source symlinks to relative
paths.  If there's a reason why you don't want to do that, tell me and I
might be able to figure something out.

> Second question:
> 
> Is there a way of using --exclude to reference symlink _targets_, rather
> than the filename itself?

No.  There's an enhancement request for this capability:

https://bugzilla.samba.org/show_bug.cgi?id=1670

Matt

Attachment: signature.asc
Description: This is a digitally signed message part

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to