Solved

Comparing files and directories after a file copy

Posted on 2007-04-11
5
199 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 M 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now