--link-dest not working?

Parke Bostrom parke.bostrom at gmail.com
Mon Dec 7 20:21:48 MST 2009


Hi,

Why is rsync with --link-dest not working as I expect it to in the
following example?

----
rm -r a b
mkdir a
mkdir b
echo 'line one' > a/c.txt
rsync -a --link-dest=a a/ b/
stat -c %i a/c.txt b/c.txt
echo 'line two' >> a/c.txt
cat b/c.txt

echo

# compare:
rm b/c.txt
ln a/c.txt b/c.txt
stat -c %i a/c.txt b/c.txt
echo 'line three' >> a/c.txt
cat b/c.txt
----

When I run the above, I get the following output:

----
173665
173667
line one

173665
173665
line one
line two
line three
----

I would expect the first 2 inode numbers to be the same, and the first
cat to output "line one" and "line two".

But it appears that rsync is not liking b/c.txt to be the same file as a/c.txt.

Any help would be appreciated.

Thanks!

-Parke


More information about the rsync mailing list