Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 06-10-2009, 03:48 AM   #1
LQ Newbie
Registered: May 2009
Location: Paris
Distribution: Ubuntu
Posts: 7

Rep: Reputation: 0
Question Questions about rsync and '--link-dest' flag

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/

Now to do an incremental backup, I tried the following :

%> rsync -av a/

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/

followed by

%> ssh 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
Old 07-14-2011, 12:55 PM   #2
LQ Newbie
Registered: Oct 2008
Posts: 2

Rep: Reputation: 1
the DIR is relative (to destination dir)

In the man page under --copy-dest
there is a reminder:

"If DIR is a relative path, it is relative to the destination directory."

That explains the .. needed. After all, without the full path, the DIR must
be relative to "something".


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync -a doesn't preserve the timestamp of symbolic link? guavajuice Linux - General 1 08-12-2008 05:02 PM
Problem using rsync for backups: link-dest JosephS Linux - Software 0 02-21-2008 07:43 AM
log source and dest cyb0rg777 Linux - Security 1 11-02-2006 08:28 AM
Dest Unreachable with PPP csb Linux - Networking 4 07-31-2005 06:36 AM
How can I stop rsync from deleting data if network link is dropped? skyfly Linux - Networking 2 06-30-2004 10:35 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:22 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration