?
Solved

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

Posted on 2006-03-29
11
Medium Priority
?
184 Views
Last Modified: 2010-04-13
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.
0
Comment
Question by:charlietou
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 18

Expert Comment

by:carl_legere
ID: 16323575
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
 
LVL 78

Expert Comment

by:Rob Williams
ID: 16323766
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
 
LVL 5

Accepted Solution

by:
rleepy earned 800 total points
ID: 16324440
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
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
LVL 3

Author Comment

by:charlietou
ID: 16332572
rleepy,

Do you know if robocopy will run on Win2K?
0
 
LVL 5

Expert Comment

by:rleepy
ID: 16332804
Should be able to.
Note: The Windows Server 2003 Resource Kit Tools are not supported on 64-bit platforms.
0
 
LVL 1

Expert Comment

by:inovatech
ID: 16333237
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
 
LVL 78

Expert Comment

by:Rob Williams
ID: 16431713
charlietou, did any of the above suggestions work for you?
--Rob
0
 
LVL 3

Author Comment

by:charlietou
ID: 16435499
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
 
LVL 78

Assisted Solution

by:Rob Williams
Rob Williams earned 200 total points
ID: 16435574
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
 
LVL 3

Author Comment

by:charlietou
ID: 16450539
Thanks everyone for your input.

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

Charlie T.

0
 
LVL 78

Expert Comment

by:Rob Williams
ID: 16450683
Thanks Charlie,
--Rob
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
LinkedIn blogging is great for networking, building up an audience, and expanding your influence as well. However, if you want to achieve these results, you need to work really hard to make your post worth liking and sharing. Here are 4 tips that ca…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

850 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