Solved

Comparing files and directories after a file copy

Posted on 2007-04-11
5
204 Views
Last Modified: 2010-04-16
I am currently using batch files to back up and restore data to our systems during rollouts and migrations. Source and destination OS is Windows XP Pro.

I need to find a way to check the source and destination to make sure they match afterwards to be sure all files are copied. I've seen issues where the hard drive is failing and it didn't copy all of the data and i didn't realize it because the batch file started copying the next set of data (like "favorites").

I've tried windiff, fc, and so on but nothing that is automated enough just to show a results screen if they are different sizes. Example: the local mydocs folder has 5000 files totaling 3.5GB and the server has only 4000 files totaling 2.3GB... i want to see the files and folders in a summary that were NOT copied.

Any ideas on this? BTW: i've gone through the XP and VB sections and have not been able to find a solution that matches what I need.

Thanks!
0
Comment
Question by:ViperZ2000
5 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 18892209
I would highly recommend your using robocopy for this...
http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&DisplayLang=en

It will copy source to target and then update it at any point thereafter with any file(s) that have been changed or were not copied in the process.

Better still, it includes a retry parameter to allow you to specify the number of attempts to make before giving up (if any)...
0
 
LVL 6

Expert Comment

by:DocGyver
ID: 18892261
Robo copy is most likely the thing you are looking for to solve your over all problem but for the compare with reports part of your question I _highly_ recomment Beyond COmpare from:

http://scootersoftware.com/

I've been using BC for years now and hands down it is the best comparitor I've used.   I use it primarily for GUI comparisons but it has a command line interface for generating reports and you can specify how you want the files compare: full binary, size, date, crc, etc with any combination there of.

Doc..
0
 
LVL 77

Expert Comment

by:Rob Williams
ID: 18892576
If looking for a utility to compare after the fact, you can use 2XExplorer. It will allow you to mirror two windows displaying the same folders in each file structure. As you browse through one set of folders, the other widow will display the same, matching folder structure, at the same time, in the other window. Differences, or missing files are highlighted, and it's free.
http://www.tucows.com/preview/195884
0
 
LVL 25

Accepted Solution

by:
Ron Malmstead earned 500 total points
ID: 18892610
Did you use the /D switch....so that it will only copy modified or new files ?
Example
xcopy "\\server1\share\*.*" "\\server2\share\*.*" /D /E /I /H /Y /Z
This will copy all files, including hidden and system, all directories including empty ones, overwriting if the file that exists is older than the one your copying, without prompting, and copies all files in restartable mode in case of network error.

If you run this xcopy command with the /D switch...it is automatically comparing the two directories, as well as subdirectories, and files, by "DATE".  When the command is finished...if you run it again...in a short amount of time it should say 0 files copied, because no changes have occurred.  Pretty much syncronizing two directories.

good luck.
0
 

Author Comment

by:ViperZ2000
ID: 18896803
Just to be clear, this is being done is mass migrations where we may have 250 computers per day over a 10 day period.

xuserx2000 - i like this option but will need to test it out to see how much time it adds.

keep the suggestions coming!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question