I am puzzled as to why I can't get the option --link-dest to work
properly. When I use this option when both source and destinations are
on a local filesystem the hard-linking of the target against the
link-dest directory does work, but when the source is a remote directory
(via ssh or rsync server) hard links are not created. I suspect it has
something to do with setting the correct timestamp on the files, since
the server and client machines have clocks with a large offset, but why
would that be the case?
The version of rsync I'm using is:
rsync version 2.6.0 protocol version 27
Copyright (C) 1996-2004 by Andrew Tridgell and others
<http://rsync.samba.org/>
Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles,
IPv6, 64-bit system inums, 64-bit internal inums
The distribution is fedora core 1 with kernel 2.4.22-1.2140.nptl. Below
you can see the results of my test. Any help is appreciated.
Thanks,
-- Alberto
[ads@localhost ~/rsynctest]$ rsync
rsync://adswon.cfa.harvard.edu/ast/load/test/
drwxr-xr-x 4096 2004/01/26 15:17:47 .
-rw-r--r-- 4 2004/01/26 15:17:47 foo
[ads@localhost ~/rsynctest]$ date
Mon Jan 26 14:59:16 EST 2004
[ads@localhost ~/rsynctest]$ cat ./runtest.sh
#!/bin/sh
/bin/rm -rf orig new
# echo getting original copy
$HOME/mirror/bin/i486-linux/rsync-2.6.0 --timeout 1800 --delete -az \
rsync://adswon.cfa.harvard.edu/ast/load/test/ \
`pwd`/orig/
# echo getting second copy
$HOME/mirror/bin/i486-linux/rsync-2.6.0 --timeout 1800 --delete -az
"$@" \
--link-dest=`pwd`/orig/ \
rsync://adswon.cfa.harvard.edu/ast/load/test/ \
`pwd`/new/
/bin/ls -l `pwd`/orig `pwd`/new
[ads@localhost ~/rsynctest]$ ./runtest.sh -vvv
opening tcp connection to adswon.cfa.harvard.edu port 873
receiving file list ...
recv_file_name(.)
recv_file_name(foo)
received 2 names
done
recv_file_list done
get_local_name count=2 /home/ads/rsynctest/new/
created directory /home/ads/rsynctest/new
make_file(.,*,2)
expand file_list to 4000 bytes, did move
send_file_list done
deleting in .
recv_files(2) starting
generator starting pid=1001 count=2
delta transmission enabled
recv_generator(.,0)
set modtime of . to (1075148267) Mon Jan 26 15:17:47 2004
./
recv_generator(foo,1)
generating and sending sums for 1
count=1 rem=4 blength=700 s2length=2 flength=4
generate_files phase=1
recv_files(foo)
recv mapped foo of size 4
foo
got file_sum
renaming .foo.cJC1Ra to foo
set modtime of foo to (1075148267) Mon Jan 26 15:17:47 2004
recv_files phase=1
generate_files phase=2
recv_generator(.,0)
set modtime of . to (1075148267) Mon Jan 26 15:17:47 2004
recv_files finished
wrote 127 bytes read 139 bytes 532.00 bytes/sec
total size is 4 speedup is 0.02
_exit_cleanup(code=0, file=main.c, line=1064): about to call exit(0)
/home/ads/rsynctest/new:
total 4
-rw-r--r-- 1 ads ads 4 Jan 26 2004 foo
/home/ads/rsynctest/orig:
total 4
-rw-r--r-- 1 ads ads 4 Jan 26 2004 foo
**************************************************************************
Alberto Accomazzi, NASA Astrophysics Data System http://ads.harvard.edu
Harvard-Smithsonian Center for Astrophysics http://cfa-www.harvard.edu
60 Garden St, MS 31, Cambridge, MA 02138, USA aaccomazzi@cfa.harvard.edu
**************************************************************************