I have two questions about using rsync with the --link-dest=[file] flag.
Question #1 :
--------------
Suppose I create a "backup" of directory a/ to a0/, using
%> rsync -av a/ a0/
Now I'd like to do an "incremental backup" of a/ to a second directory a1/. The command
%> rsync -av --link-dest=../a0/ a/ a1/
does the job, and creates hardlinks in a1/ to files that are unchanged between a1/ and a0/.
My question is, Why does rsync require the syntax "--link-dest=../a0/" and not just "--link-dest=a0/"? (When I use the latter syntax, I don't get hardlinks between unchanged files, only copies).
Question #2
-------------
Suppose I want to do the same thing as above, but this time, directories a0/ and a1/ are located on file system accessible only by ssh.
To create a0/ originally, I use :
%> rsync -av a/
me@remote.site:a0/
Now to do an incremental backup, I tried the following :
%> rsync -av --link-dest=me@remote.site:a0/ a/
me@remote.site:a1/
but this doesn't work. Directory a1/ is created, but with copies, rather than hardlinks, to unchanged files.
I've tried other variations on the above (adding complete or relative paths) but it seems that '--link-dest' doesn't work in this context.
What I have done instead is :
%> rsync -av a/
me@remote.site:a_tmp/
followed by
%> ssh
me@remote.site rsync -av --link-dest=../a0/ a_tmp/ a1/
This works, and creates hard links between unchanged files in a0/ and a1/.
My questions is, Is this the only way to do incremental backups across unmounted files systems? Or am I missing something? Any suggestions would be very useful.
My local version of rsync is :
rsync version 2.6.9 protocol version 29
And remote version is :
rsync version 2.6.2 protocol version 28