Compare directories, delete files from one that aren't in the other

Hi folks,

I am using xcopy as a backup mechanism from one drive to another.  Periodically, I want to clean out the backup and delete any files that have been deleted from the source.  Can someone let me know an efficient way to do this?

Thanks.
LVL 3
charlietouAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

carl_legereCommented:
map a drive letter from one to the other
use a third party utility, Duplicate File Manager to find and delete the duplicates.

OR

upgrade your process from xcopy to syncback, (third party) it has many options including delete on B if deleted from A
0
Rob WilliamsCommented:
As Carl suggested, you can use a 3rd party tool. I use 2xExplore. It allows you to mirror file structures in a left and right window so you can very quickly, browse though folders and compare, add, and delete.
http://www.snapfiles.com/get/2xexplorer.html
--Rob
0
rleepyCommented:
Have you tried robocopy from Windows Server 2003 Administration Tools Pack?
http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&DisplayLang=en
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

charlietouAuthor Commented:
rleepy,

Do you know if robocopy will run on Win2K?
0
rleepyCommented:
Should be able to.
Note: The Windows Server 2003 Resource Kit Tools are not supported on 64-bit platforms.
0
inovatechCommented:
Another tool you might try is calle Unison.  If you've ever used rsync in a UNIX environment it keeps directories in sync with eachother.  It has a commandline and a GUI version so you can work with what you are comfortable with.

http://www.cis.upenn.edu/~bcpierce/unison/

Brian
0
Rob WilliamsCommented:
charlietou, did any of the above suggestions work for you?
--Rob
0
charlietouAuthor Commented:
Hi,

I haven't had a chance to actually try them out, but Robocopy looks like the best option for me at this point.

The client I would be using this for has literally thousands of directories within his file structure, and I'd need an automated tool for doing the comparison and deletion.  2XExplorer looks like a nice tool (I haven't gone beyond the description page) but it looks like I'd have to do much of the comparison myself.  I'm willing to be corrected if that's not the case.

Thanks,

Charlie T.
0
Rob WilliamsCommented:
Thanks for the update Charlie. I agree, if you need it automated, RoboCopy would be a much better way to go. It will definitely work with Win2K by the way. It even works with NT. I have seen numerous recommendations in the past suggesting best to use the newest/XP version, which is backward compatible, as it eliminates a few bugs.
Good luck,
--Rob
0
charlietouAuthor Commented:
Thanks everyone for your input.

Have a good day, (or night, depending on when you read this :-) ),

Charlie T.

0
Rob WilliamsCommented:
Thanks Charlie,
--Rob
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 2000

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.