This is a bug, right? (--link-dest)

Randall Cotton recotton at earthlink.net
Mon Apr 5 12:57:37 MDT 2010


I had a heckuva time getting hard link snapshot backups to work. I traced
my troubles down to what appears to be an rsync bug:

This works as expected (a hard link is made)
************
rm -rf a b
mkdir a b
echo foo > a/tmp
rsync -a a/ b/a.1
rsync -a --link-dest=../a.1 a/ b/a
ls -i b/*/tmp

the above yields, for example:
4235593 b/a.1/tmp  4235593 b/a/tmp
************

This does not (a copy is made instead of a hard link)
************
rm -rf a b
mkdir a b
echo foo > a/tmp
rsync -a a/ b/a.1
rsync -a --link-dest=a.1 a b
ls -i b/*/tmp

the above yields, for example:
4235593 b/a.1/tmp  4235595 b/a/tmp

************

The only difference is running the second rsync without a "/" following
the source (adjusting other arguments accordingly). But my understanding
is that these are two ways of running rsync that should accomplish
precisely the same thing.

That is:

rsync a/ b/a
is supposed to do exactly the same thing as
rsync a b

I happen to prefer the latter syntax, and that's apparently how I got into
trouble.

Am I missing something here? Should I file a bug report?

I tried this on several setups and got the same result, but for reference
here's one:
rsync v 3.0.6 on (stock) Ubuntu 9.10



More information about the rsync mailing list