rsync with --link-dest doesn't create hard links


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers rsync with --link-dest doesn't create hard links
# 1  
Old 07-10-2010
Question rsync with --link-dest doesn't create hard links

I have been experimenting with rsync as a scriptable backup option, reading various example and tips pages, including Time Machine for every Unix out there - IMHO

That page seems to describe the exact behavior I want: The ability to make a "full backup" snapshot regularly, but with rsync comparing to an existing backup and using hard links where possible to avoid using more disk space to store multiple copies of files already on the destination.

I am currently testing rsync to simply copy a small test directory on the same disk, but thus far, I have not observed the --link-dest= option to create any hard links.

Code:
$ rsync -av --exclude-from=myexcludes rsynctestfolder1/ rsynctestfolder2

This creates a copy of folder 1 into folder 2 as expected. (And, BTW, the excludes in the named exclude file are behaving correctly, but that's not the issue)

Code:
$ rsync -av --link-dest=rsynctestfolder2 --exclude-from=myexcludes rsynctestfolder1/ rsynctestfolder3

This creates another copy of test folder 1 into folder 3. Now, I would expect that since all the items needed in 3 were just put into 2 and have not changed between the two operations, most (all) of the items in folder 3 would be hard links. However, using stat to examine the files in the various folders, the identically-named corresponding files in the two backups have unique inodes and only report 1 link each, so they are obviously separately-copied distinct files in the two destinations, not the hard links I am expecting.

NB, this is all on Mac OS X 10.4.11, but this is all purely command-line; my rsync --version reports as 2.6.9 with capabilities including hard links.

Thanks for any suggestions. --JMF
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using rsync --link-dest pointing to a remote server

Ok, I'm trying to figure out how to reference a remote file using the rsync --link-dest parameter. Here is the code I have so far: # # FILESERVER INCREMENTAL BACKUP SCRIPT # # Remove previous log file rm /usr/local/bin/rsync-incremental.log # Set daily variables DAY0=`date -I`... (6 Replies)
Discussion started by: Orionizer
6 Replies

2. Shell Programming and Scripting

Create tar file excluding all hard links

I have a problem with tar. Taring a folder with a lot of contents, causes the tar to contain hard links to some files, seen with the same name but 0 in size. The hard links don't exist in the first place. How can I prevent that from happening? I am using the -T option with either -n or... (2 Replies)
Discussion started by: Tribe
2 Replies

3. UNIX for Dummies Questions & Answers

Help with rsync using link-dest

Hi, I'm trying to keep backups of my home directory (i.e. back it up every day or so) using rsync with link-dest. This is how I do it, rsync -avh --delete --link-dest=/media/disk/oldbackup/ /home/user/ /media/disk/newbackup rm -f /media/disk/oldbackup ln -s newbackup... (1 Reply)
Discussion started by: lost.identity
1 Replies

4. AIX

List all the soft links and hard links

Hi I'm logged in as root in an aix box Which command will list all the soft links and hard links present in the server ? (2 Replies)
Discussion started by: newtoaixos
2 Replies

5. Solaris

Hard Links and Soft or Sym links

When loooking at files in a directory using ls, how can I tell if I have a hard link or soft link? (11 Replies)
Discussion started by: Harleyrci
11 Replies

6. UNIX for Dummies Questions & Answers

Difference between hard link and soft link

Hi Experts, Please help me out to find out difference between a hard link and a soft link. I am new in unix plz help me with some example commands ( for creating such links). Regards S.Kamakshi :) (2 Replies)
Discussion started by: kamakshi s
2 Replies

7. UNIX for Dummies Questions & Answers

Hard Link vs SOft Link????

Hi PLease let me know the usage of Hard Link vs Soft Link i.e what is the basic difference and what happens when one file is changed or deleted in both the cases??? thanks (3 Replies)
Discussion started by: skyineyes
3 Replies

8. UNIX for Dummies Questions & Answers

need some info about symbolic link and hard link

hello folks how y'all doin well i have some questions about symbolic link and hard link hope some one answer me i open terminal and join as root and i wrote ln -s blah blah then i wrote ls i see red file called blah blah but didn't understand what is this can some one explain and... (2 Replies)
Discussion started by: detective linux
2 Replies

9. UNIX for Dummies Questions & Answers

Difference between hard link and soft link in unix

Hi All, Can any one please explain me what is the difference between hard link and soft link in UNIX. Thanks in advance Raja Chokalingam. (2 Replies)
Discussion started by: RAJACHOKALINGAM
2 Replies

10. UNIX for Advanced & Expert Users

Differences between hard link and soft link

Hi all! I'd like to know the differences between hard links and soft links. I've already read the ln manpage, but i'm not quite sure of what i understood. Does a hard link sort of copy the file to a new name, give it the same inode number and same rights? What exactly should I do to do this:... (3 Replies)
Discussion started by: penguin-friend
3 Replies
Login or Register to Ask a Question