How to copy very large directory trees

I have constant trouble with XCOPY/s for multi-gigabyte transfers.
I need a utility like XCOPY/S that remembers where it left off if I reboot. Is there such a utility? How about a free utility (free as in free beer)?

How about an md5sum sanity check too?

I posted the above query in another forum. Answers to the above question are welcome here too. My question for this forum is: How feasible is it it write a script in groovy, python, cygwin bash, Activestate perl, powershell, etc... to implement a linux "cp -R" or windows "xcopy/s" program that can continue where it left off after a reboot?

I cannot think of clever way do do this easily -- can you?

I could write it in C++ -- but I'm hoping for something more quick and elegant.

Thanks
Siegfried

The rsync utility has all the features you listed as well as many more you man not have thought of.

How do I get the restart feature?
I tried the little script at linux - Resume rsync over SSH after broken connection? - Super User
and it seemed to work fine on a small directory.

Do I need to install the rsync deamon to have the automatic restart feature?
I think not -- but I'm not sure.

Does the --partial flag mean that if we previously rebooted in the middle of a transfer and we are executing this again, it will continue where it left off in the source directory? After reading the documentation, it does not look to me like "--partial" refers to partially copied directories but rather partially copied files.

Is there a way to tell rsync to only copy the files in the source directory that have not been correctly copied to the destination yet (because we were previously interrupted with a reboot)?

Thanks!
Siegfried

Rsync will skip any files that are already in the destination by default it uses file size+date+time or with the -c option computes a checksum.

--partial saves a partially transfered file and will resume from where it was, without this, a file that is in being transfered when a server is rebooted or goes off the network will be deleted and the file re-transfered. This can be important if large files are being transfered and starting again will waste a lot of bandwidth.

--del can be important to remove files on the destination side that don't exist on the source side.

Try is something like this to copy a directory path keeping owner/permissions and removing and file in dest not in source

rsync -avc --del --partial /path/to/source/files/ dest:/path/to/dest/files

also consider something like --bwlimit=4000 to avoid swamping your network by limiting the transfer to 4Mbps.