Skipping hardlinks in a copy

Sriram Ramkrishna sramkris at
Thu Mar 8 05:22:08 GMT 2007

Hi folks, I've been googling around for awhile but I can't seem to find
an answer to my question. 

I have a number of filesystems that contain thousands of hard links due
to some bad organization of data.  Rsync, cpio and various other
utilities fail to copy this data because I think there might be some
cycles in it.  (you know you have troubles if cpio can't copy it!)

What I thought I would do instead is to copy the data but skip any files
that are hard links.  Then after the copy is finished, I will use some
kind of find . -type l type command that finds the hard links and then
make a script to recreate it.  This saves me a lot of trouble with not
having to stat the files and not having the receive side balloon up.

Is there a way to have it skip hard links when doing an rsync?
Or is there some other mystic incantation that I can use that might
accomplish the same thing.


More information about the rsync mailing list