Question

I just copied a ton of data from a machine running Windows 7 Ultimate to a server running Ubuntu Server LTS 10.04. I used the robocopy utility via PowerShell to accommplish this task, but I couldn't find any informaiton online regarding whether Robocopy verifies the copied file's integrity once it is copied to the server.

First of all, does anyone know if this is done inherently? There is no switch that explicitly allows you to add verification to a file transfer.

Second, if it doesn't or there is uncertainty about whether or not it does, what would be the simplest method to accomplish this for multiple directories with several files/sub-directories?

Thanks!

Was it helpful?

Solution

The easiest mechanism I know would rely on an md5sum and Unix-like find utility on your Windows machine.

You can generate a manifest file of filenames / md5sums:

find /source -type f -exec md5sum {} \; > MD5SUM

Copy the MD5SUM file to your Linux machine, and then run:

cd /path/to/destination
md5sum --quiet -c MD5SUM

You'll get a list of files that fail:

$ md5sum --quiet -c /tmp/MD5SUM 
/etc/aliases: FAILED
md5sum: WARNING: 1 of 341 computed checksums did NOT match

OTHER TIPS

Much easier method is to use unix uilities diff and rsync

With diff you can compare two file but you can compare also two directories. With diff I would recomend this command:

diff -r source/directory/ destination/directory

-r forces diff to analyse directorysor recursively

The second option is to use rsync which is ment to sync files or directories but with -n option you can use it also to analyes differencies between directories. rsync also works even when the files are not on the same host it means on one there can be remote host and you can acess it even with ssh. Pluss rsync is really flexible with its meny options avaialbe

rsync -avn --itemize-changes --progress --stats source/directory/ destination/directory/
  • -n option makes rsync do a "dry-run", meaning it makes no changes on the
  • -a otion includes in it "Recursive mode,symbolic links,file permissions, file timestamps, file owner parameter, file group paratmeter
  • -v increase verbosity
  • --itemize-changes output a change-summary for all updates

Here you can find even more ways how to compear directories: https://askubuntu.com/questions/12473/file-and-directory-comparison-tool

On rsync wikipedia page you can find windows alternative programs for rsync

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top