I've looked around for a bug report on this problem and haven't seen one, so I
apologize if this has already been discussed.

I have a homegrown script which uses rsync to maintain daily backups of roughly
twenty Redhat Linux systems running RH 7.2, 7.3, AS 3, and AS 4.  As there are
files with multiple links on the source systems, it is necessary to call rsync
using the -H (--hard-links) option to maintain accurate backups.  The backup
script uses --link-dest to create daily snapshots of each system where all
unchanged files from a particular system share storage across all backup
snapshots for that system, i.e. if a file hasn't changed as far as rsync is
concerned, it only exists once in the backup server's filesystem, but is linked
to a directory entry in every snapshot.  This works fine provided the file(s)
aren't linked more than once in the source system.  When files are linked
multiple times in the source, not all of the links wind up in the snapshot.

This can be easily reproduced locally with the following example:

########################################################################

[EMAIL PROTECTED] tmp]$ rsync --version
rsync  version 2.6.4  protocol version 29
Copyright (C) 1996-2005 by Andrew Tridgell and others
<http://rsync.samba.org/>
Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles, 
              inplace, IPv6, 64-bit system inums, 64-bit internal inums

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

[EMAIL PROTECTED] tmp]$ cat /etc/redhat-release 
Red Hat Linux release 7.3 (Valhalla)
[EMAIL PROTECTED] tmp]$ 


[EMAIL PROTECTED] tmp]$ mkdir from to-1 to-2
[EMAIL PROTECTED] tmp]$ touch from/a
[EMAIL PROTECTED] tmp]$ ln from/a from/b



[EMAIL PROTECTED] tmp]$ rsync -avH from/ to-1/
building file list ... done
./
b
a => b

sent 168 bytes  received 56 bytes  448.00 bytes/sec
total size is 0  speedup is 0.00


[EMAIL PROTECTED] tmp]$ ls -l to-1
total 0
-rw-rw-r--    2 rjaffey  rjaffey         0 Apr 23 13:40 a
-rw-rw-r--    2 rjaffey  rjaffey         0 Apr 23 13:40 b

# Notice that the links were properly preserved in the to-1 directory (first
snapshot).





[EMAIL PROTECTED] tmp]$ rsync -avH --link-dest=/tmp/to-1/ from/ to-2/
building file list ... done
./

sent 118 bytes  received 26 bytes  288.00 bytes/sec
total size is 0  speedup is 0.00

[EMAIL PROTECTED] tmp]$ ls -l to-2
total 0
-rw-rw-r--    3 rjaffey  rjaffey         0 Apr 23 13:40 a


# Notice only one of the links was created, the other one is simply not there.





[EMAIL PROTECTED] tmp]$ rsync -avH --link-dest=/tmp/to-1/ from/ to-2/
building file list ... done
b => a

sent 120 bytes  received 28 bytes  296.00 bytes/sec
total size is 0  speedup is 0.00

[EMAIL PROTECTED] tmp]$ ls -l to-2
total 0
-rw-rw-r--    4 rjaffey  rjaffey         0 Apr 23 13:40 a
-rw-rw-r--    4 rjaffey  rjaffey         0 Apr 23 13:40 b
[EMAIL PROTECTED] tmp]$

# Notice that if I run exactly the same rsync command a second time, the second
link is created.

###############################################################################

The actual rsync command used to do the backups is a little more extensive, but
the same behavior occurs.

Am I missing something here, or is this really a bug?

Thanks,
Rafe
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to