I have two large files (2+MB), one of which is a corrupted version of
the other. I tried to rsync the good file to the corrupted one,
hoping it would repair the few bad bytes, but it did nothing. (I
tried to be careful not to specify the --archive or --update flags,
either explicitly or implicitly.)
The original problem occurrend on a transfer from one computer to
another. I then did a number of experiments with copies of the two
files on the same computer:
1. If I touched only the corrupted file, so the file times differed,
then rsync did update the destination file.
2. If I used the --checksum flag, then it updated correctly.
But just a plain rsync failed to notice that the files were different.
My tests were performed under Red Hat Linux 7.2 on a Pentium III
machine. I used rsync version 2.5.5, which I just downloaded and
compiled, but the problem originally occurred with older versions of
rsync.
I attach a log of my session showing the several commands (with
debugging enabled) that did not work, followed by the one with -c
(--checksum) that did work.
Any idea why this failed to update? Did I do something wrong? Is it
one of those once-in-a-lifetime coincidences by with the checksum
algorithm fails? Or is this a real bug? I'd be happy to send someone
the two files to play with, but they are pretty big!
--Michael Fischer
=================================================| Michael Fischer
<fischer-michael@cs.yale.edu> |
| Professor of Computer Science |
=================================================
(daphne:3.135)~/tmp> rsync --version
rsync version 2.5.5 protocol version 26
Copyright (C) 1996-2002 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
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.
(daphne:3.136)~/tmp> ll openssl-engine-0.9.6a.tar.gz
openssl-engine-0.9.6a.tar.gz.BAD
-rw-r--r-- 1 mike fischer 2185324 May 4 22:59
openssl-engine-0.9.6a.tar.gz
-rw-r--r-- 1 mike fischer 2185324 May 4 22:59
openssl-engine-0.9.6a.tar.gz.BAD
(daphne:3.137)~/tmp> cmp openssl-engine-0.9.6a.tar.gz
openssl-engine-0.9.6a.tar.gz.BAD
openssl-engine-0.9.6a.tar.gz openssl-engine-0.9.6a.tar.gz.BAD differ: char
1591809, line 6124
(daphne:3.138)~/tmp> rsync -vvvv openssl-engine-0.9.6a.tar.gz
openssl-engine-0.9.6a.tar.gz.BAD
cmd= machine= user= path=openssl-engine-0.9.6a.tar.gz.BAD
cmd=. openssl-engine-0.9.6a.tar.gz.BAD
make_file(4,openssl-engine-0.9.6a.tar.gz)
expand file_list to 4000 bytes, did move
[32089] i=0 <NULL> openssl-engine-0.9.6a.tar.gz mode=0100644 len=2185324
send_file_list done
file list sent
send_files starting
server_recv(2) starting pid=32090
recv_file_name(openssl-engine-0.9.6a.tar.gz)
received 1 names
[32090] i=0 <NULL> openssl-engine-0.9.6a.tar.gz mode=0100600 len=2185324
recv_file_list done
get_local_name count=1 openssl-engine-0.9.6a.tar.gz.BAD
generator starting pid=32090 count=1
recv_generator(openssl-engine-0.9.6a.tar.gz.BAD,0)
openssl-engine-0.9.6a.tar.gz.BAD is uptodate
generate_files phase=1
send_files phase=1
recv_files(1) starting
recv_files phase=1
generate_files phase=2
send files finished
total: matches=0 tag_hits=0 false_alarms=0 data=0
recv_files finished
client_run waiting on 32090
wrote 59 bytes read 20 bytes 158.00 bytes/sec
total size is 2185324 speedup is 27662.33
_exit_cleanup(code=0, file=main.c, line=578): entered
_exit_cleanup(code=0, file=main.c, line=578): about to call exit(0)
(daphne:3.139)~/tmp> cmp openssl-engine-0.9.6a.tar.gz
openssl-engine-0.9.6a.tar.gz.BAD
openssl-engine-0.9.6a.tar.gz openssl-engine-0.9.6a.tar.gz.BAD differ: char
1591809, line 6124
(daphne:3.140)~/tmp> rsync -c -vvvv openssl-engine-0.9.6a.tar.gz
openssl-engine-0.9.6a.tar.gz.BAD
cmd= machine= user= path=openssl-engine-0.9.6a.tar.gz.BAD
cmd=. openssl-engine-0.9.6a.tar.gz.BAD
make_file(4,openssl-engine-0.9.6a.tar.gz)
expand file_list to 4000 bytes, did move
[32113] i=0 <NULL> openssl-engine-0.9.6a.tar.gz mode=0100644 len=2185324
send_file_list done
file list sent
send_files starting
server_recv(2) starting pid=32114
recv_file_name(openssl-engine-0.9.6a.tar.gz)
received 1 names
[32114] i=0 <NULL> openssl-engine-0.9.6a.tar.gz mode=0100600 len=2185324
recv_file_list done
get_local_name count=1 openssl-engine-0.9.6a.tar.gz.BAD
generator starting pid=32114 count=1
recv_generator(openssl-engine-0.9.6a.tar.gz.BAD,0)
recv_files(1) starting
send_files(0,openssl-engine-0.9.6a.tar.gz)
count=0 n=700 rem=0
send_files mapped openssl-engine-0.9.6a.tar.gz of size 2185324
calling match_sums openssl-engine-0.9.6a.tar.gz
openssl-engine-0.9.6a.tar.gz
sending file_sum
false_alarms=0 tag_hits=0 matches=0
sender finished openssl-engine-0.9.6a.tar.gz
recv_files(openssl-engine-0.9.6a.tar.gz.BAD)
generate_files phase=1
recv mapped openssl-engine-0.9.6a.tar.gz.BAD of size 2185324
send_files phase=1
data recv 32768 at 0
data recv 32768 at 32768
data recv 32768 at 65536
data recv 32768 at 98304
data recv 32768 at 131072
data recv 32768 at 163840
data recv 32768 at 196608
data recv 32768 at 229376
data recv 32768 at 262144
data recv 32768 at 294912
data recv 32768 at 327680
data recv 32768 at 360448
data recv 32768 at 393216
data recv 32768 at 425984
data recv 32768 at 458752
data recv 32768 at 491520
data recv 32768 at 524288
data recv 32768 at 557056
data recv 32768 at 589824
data recv 32768 at 622592
data recv 32768 at 655360
data recv 32768 at 688128
data recv 32768 at 720896
data recv 32768 at 753664
data recv 32768 at 786432
data recv 32768 at 819200
data recv 32768 at 851968
data recv 32768 at 884736
data recv 32768 at 917504
data recv 32768 at 950272
data recv 32768 at 983040
data recv 32768 at 1015808
data recv 32768 at 1048576
data recv 32768 at 1081344
data recv 32768 at 1114112
data recv 32768 at 1146880
data recv 32768 at 1179648
data recv 32768 at 1212416
data recv 32768 at 1245184
data recv 32768 at 1277952
data recv 32768 at 1310720
data recv 32768 at 1343488
data recv 32768 at 1376256
data recv 32768 at 1409024
data recv 32768 at 1441792
data recv 32768 at 1474560
data recv 32768 at 1507328
data recv 32768 at 1540096
data recv 32768 at 1572864
data recv 32768 at 1605632
data recv 32768 at 1638400
data recv 32768 at 1671168
data recv 32768 at 1703936
data recv 32768 at 1736704
data recv 32768 at 1769472
data recv 32768 at 1802240
data recv 32768 at 1835008
data recv 32768 at 1867776
data recv 32768 at 1900544
data recv 32768 at 1933312
data recv 32768 at 1966080
data recv 32768 at 1998848
data recv 32768 at 2031616
data recv 32768 at 2064384
data recv 32768 at 2097152
data recv 22636 at 2129920
data recv 32768 at 2152556
got file_sum
renaming .openssl-engine-0.9.6a.tar.gz.BAD.0b1Gj4 to
openssl-engine-0.9.6a.tar.gz.BAD
recv_files phase=1
generate_files phase=2
send files finished
total: matches=0 tag_hits=0 false_alarms=0 data=2185324
recv_files finished
client_run waiting on 32114
wrote 2185703 bytes read 36 bytes 4371478.00 bytes/sec
total size is 2185324 speedup is 1.00
_exit_cleanup(code=0, file=main.c, line=578): entered
_exit_cleanup(code=0, file=main.c, line=578): about to call exit(0)
(daphne:3.141)~/tmp> cmp openssl-engine-0.9.6a.tar.gz
openssl-engine-0.9.6a.tar.gz.BAD
(daphne:3.142)~/tmp>