To clarify:
When I said:
: rsync a/ b/a
: is supposed to do exactly the same thing as
: rsync a b
What I meant was:
This:
************
rm -rf a b
mkdir a b
echo foo > a/tmp
rsync -a a/ b/a
ls -lR b
which yields, for instance:
b:
total 4
drwxr-xr-x 2 randall randall 4096 Apr 5 14:06 a
b/a:
total 4
-rw-r--r-- 1 randall randall 4 Apr 5 14:06 tmp
************
is supposed to (and does) do exactly the same thing as:
************
rm -rf a b
mkdir a b
echo foo > a/tmp
rsync -a a b
ls -lR b
which yields, for instance:
b:
total 4
drwxr-xr-x 2 randall randall 4096 Apr 5 14:07 a
b/a:
total 4
-rw-r--r-- 1 randall randall 4 Apr 5 14:07 tmp
************
so it's at least counter-intuitive for different results to occur when you
happen to be using --dest-link, and this seems like a bug to me.
In particular, I think folks using the syntax I was using will reasonably
expect hard links to be made instead of copies.
Agreement? Disagreement?
R
----- Original Message -----
From: "Randall Cotton" <recotton at earthlink.net>
To: <rsync at lists.samba.org>
Sent: Monday, April 05, 2010 1:57 PM
Subject: This is a bug, right? (--link-dest)
: 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
:
: --
: Please use reply-all for most replies to avoid omitting the mailing
list.
: To unsubscribe or change options:
https://lists.samba.org/mailman/listinfo/rsync
: Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html