Bug 1670 - Exclude symlinks by target path
Exclude symlinks by target path
Product: rsync
Classification: Unclassified
Component: core
All Linux
: P5 enhancement
: ---
Assigned To: Wayne Davison
Rsync QA Contact
Depends on:
  Show dependency treegraph
Reported: 2004-08-26 14:55 UTC by John D. Hendrickson
Modified: 2008-06-23 19:01 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description John D. Hendrickson 2004-08-26 14:55:09 UTC

I would like you to seriously consider this.  That is: I know
its a feature request but feel it's important.

The --exlude option can't look at link targets.  I know it sounds
trivial at first but I think mirroring users need that.

Here's my problem / example:

For a mirroring situation I have /etc/hosts.$HOSTNAME on each machine
with a softlink /etc/hosts pointing to the right host file.

This makes /etc distributable (ie, excepting fstab, lilo.conf).

My problem is: mirroring /etc/host softlink writes the wrong link on
other hosts.


That is: for most link I want common rsync -uavH functionality.  But
some links aren't supposed to point to the same place on a mirrored host
because of mandatory (host specific) differences.  One might find this
situation on ftp mirrors as well.

I use rsync because it *can* replicate softlink.  But using rsync, I have
no idea what I'm about replicate, right?

Allowing link targets in --exclude lists - is the only
answer.  (note: meaning: exclude links pointing to target)

Its true.  One could run rsync twice.  One for all non-links.  Then use
find.  Then use resulting find in a loop for rsync.  But that is much
harder and would require allot of separate transfers.  It would be error
prone as well.

Personally, I can't think of a reason to allow specifying link targets
in any other place than the --exclude / --include lists.


In most directories, host based files make the directory completely
distributable - despite that some files point on a per-host basis.  This
means one can much more easily mirror functionality of unix machines
while leaving host based files alone.

I administer several unix boxes - and mirroring updates is very important
to saving [massive] ammounts of time.  Added: if one box goes down the
other is ready not just as a backup: but ready for use in place of.


The host based thing is an example.  I'm sure other's would have
important uses for exluding softlinks via their link targets as well.


John D. Hendrickson

Comment 1 Wayne Davison 2004-09-17 16:20:37 UTC
Please clarify exactly what you're suggesting for an extention.  Do you want to
be able to --exclude-symlink='*.host' and have rsync skip a symlink that ends
with .host?

It seems to me that you just need to exclude files that are symlinked on a
per-host basis (e.g. --exclude=/etc/hosts). You could alternately tell rsync to
not copy any symlimks at all by leaving out the -l option (i.e. replace -a with