"A month of sundays ago [EMAIL PROTECTED] wrote:"
> Actually, I've got one for you, though.  Since there are no insertions, you can use 
>dd on both ends, through rsh (or ssh).  use it with skip, seek, conv=notrunc, 
>count=1, and some appropriate block size (the block size of the filesystems, maybe?), 
>and 
> the sum command.  get the sum on the master with a count=1, skip=whatever, then the 
>replica.  If they're different, send the master to the replica with seek and 
>conv=notrunc.  Make sure you do the dd AND the sum all on the remote, so all you pull 
>back 
> are the checksums.  You can do this in a shell script, which would be easier than 
>hacking rsync (use an advanced shell (bash,ksh), or perl, as since you need to do 
>this, i reckon the numbers could get big.


essentially this, plus ssh.

Best to start a server application, though.


src=$1
dst=$2

blksiz=`expr 64 \* 1024`

count=0
while true; do
  srcsum=`dd if=$src count=1 bs=$blksiz skip=$count | md5sum`
  dstsum=`dd if=$dst count=1 bs=$blksiz skip=$count | md5sum`
  if [ $dstsum != $srcsum ]; then
    dd if=$src count=1 bs=$blksiz skip=$count | \
    dd of=$dst count=1 bs=$blksiz seek=$count conv=notrunc
  fi
  count=$[ $count + 1 ]
done


Peter

Reply via email to