Verify copied data between Windows & Linux shares?

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!

Answers


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

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: http://askubuntu.com/questions/12473/file-and-directory-comparison-tool

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


Need Your Help

Gen2 collection not always collecting dead objects?

c# .net garbage-collection .net-4.5

By monitoring the CLR #Bytes in all Heaps performance counter of a brand new .NET 4.5 server application over the last few days, I can notice a pattern that makes me think that Gen2 collection is not

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.