You could always bittorrent it between the hosts, but I'm not sure how to automate it offhand.
I don't do this kind of thing often so I wouldn't script it. Instead I'd build up a big one-liner to do the job. So technically this isn't one command, but it's all on one line. It's not hard to script-ify if you do this often.
$ md5sum bigfile > bigfile.md5 ; export BIGFILE="notdone" ; while [ "$BIGFILE" eq "notdone" ] ; do rsync --checksum --partial bigfile* user@remotehost:path/to/put/it/in/ ; ssh user@remotehost "cd path/to/put/it/in/; md5sum -c < bigfile.md5" | grep -Ev 'OK$' | [ `wc -l` == "0" ] && BIGFILE="done" ; done
This splits out into:
$ md5sum bigfile > bigfile.md5 ; \ # create our own checksum
export BIGFILE="notdone" ; \ # set our check variable
while [ "$BIGFILE" == "notdone" ]; do \ # recheck variable state after each pass
rsync --checksum --partial bigfile* \ # call rsync to copy
user@remotehost:path/to/put/it/in/ ; \ # and call ssh to check
ssh user@remotehost \ # connect with ssh
"cd path/to/put/it/in/; md5sum -c < bigfile.md5" \ # and run the check
| grep -Ev 'OK$' \ # ignore good output
| [ `wc -l` == "0" ] \ # if we didn't find one
&& BIGFILE="done" ; \ # set our get-out-of-jail card
done \ # and we're done
You have to setup SSH to login to your host with key authorization to run it without interaction. If you do, put an echo statement in there to tell you where it is.
Tested, but I expect the rsync options could be tweaked.
2If you are using rsync then you are using rsync - if there is no server daemon listening then it will try login via SSH, start an rsync process to act temporarily as the "server" end, and tunnel the rsync protocol the the SSH stream. Remember: when using rsync to recheck possible corrupt files against a (presumably) known-good master copy, use the
--checksumoption to force it to check the contents of everyfile instead of taking the shortcut of assuming files with the same size+timestamp are OK. – David Spillett – 2009-10-10T11:01:14.6901That's very true, unless he's NFS or SAMBA mounted the remote disk and is specifying it as if it's a local file, in which case any corruption below NFS or SAMBA won't be detected. But he didn't specify. – Randy Orrison – 2009-10-10T13:44:25.733
There is NFS on the local client, but I am copying through rsync ssh to the remote client (which is not NFS mounted). – user13798 – 2009-10-10T18:22:39.350
In which case try --checksum as David Spillett suggests. ~quack's script that passes the md5sum also looks good. – Randy Orrison – 2009-10-10T19:13:23.507