LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 06-10-2009, 03:48 AM   #1
donnaaparis
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/ 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
 
Old 07-14-2011, 12:55 PM   #2
denpick
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".
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:19 PM.

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