Skipping hardlinks in a copy

Wayne Davison wayned at
Thu Mar 8 18:14:39 GMT 2007

On Wed, Mar 07, 2007 at 09:22:08PM -0800, Sriram Ramkrishna wrote:
> Is there a way to have it skip hard links when doing an rsync?

If you mean you want to skip any file that has more than one link, you
could do this:

    find . -type f -links +1 >/path/exclude.txt

Then, you'd use the exclude.txt file via the --exclude-from option.

However, you mentioned loops, and that makes me think that the problem
is not with file loops, but dirs looping back in the hierarchy.  The
above won't help you if that is the case (since find will loop too).


More information about the rsync mailing list