Main Area and Open Discussion > Living Room
Problem with merging folders
(1/1)
questorfla:
This is more like a nuisance and could be that I just don't know the right way to do this. I have several backup drives that contain folders with hundreds of files in each. Most are identical as they are just dated backups done 3 months apart.
With the huge increase in drive size I have been asked to put all the contents together onto a single drive. Copying folder A on a backup drive into the folder A on the Main drive. Normally, I get the message that the file already exists do I want to overwrite or skip. Since the files are identical I could just say overwrite and let it run. But it takes a LOT longer to do that than to say skip. Then when done delete the folder, files and all from the backup drive But there are many copies of these backups so I have to do this until all the folders are only on the one main drive, then make a single backup.
I was wondering if there is a command line switch that would say IF the file already exists on the target drive then delete it from the one you are copying from saving me having to go back and delete all these folders and files.
Something that would >copy from A to B and if the file is already on B then delete it from A.
Thanks .. I will probably feel foolish when someone tells me that is a normal command line switch
TaoPhoenix:
What version of OS are you on? Windows 7 has a couple of built in tools for some of this kind of thing. I remember from work that it would do things like "keep the duplicate second copy" or "use this solution for all conflicts". Then you really could set it going, then go to lunch or something.
4wd:
robocopy <source> <dest>
From SuperUser:
--- Code: Text ---File Exists In Exists In Source/Dest Source/Dest Source/DestClass Source Destination File Times File Sizes Attributes=========== =========== ================ =============== ============= ============Lonely Yes No n/a n/a n/aTweaked Yes Yes Equal Equal DifferentSame Yes Yes Equal Equal EqualChanged Yes Yes Equal Different n/aNewer Yes Yes Source > Dest n/a n/aOlder Yes Yes Source < Dest n/a n/aExtra No Yes n/a n/a n/aMismatched Yes (file) Yes (directory) n/a n/a n/aBy default, Lonely files (and directories) are always copied, unless /XL switch is used. Changed, Newer and Older files will be considered to be candidates for copying (subject to further filtering described below), Same files will be skipped (not copied), and Extra and Mismatched files (and directories) will simply be reported in the output log.
Normally, Tweaked files are neither identified nor copied – they are usually identified as Same files by default. Only when switch /IT is used will the distinction between Same and Tweaked files be made, and only then will Tweaked files be copied.
--- End quote ---
So if the source and dest files are really the same, (file date and size), you can just delete the whole directory after it's run.
questorfla:
Sorry. I really have to find the option for "notify me when a reply is posted".
Or figure out where they go when I get them.
Thanks for the Useful tip on Robo-Copy. I am SOOOO Old School. Still write batch files with X-copy :)
Robo would probably do it very nicely. Has all the Whistles and Bells DOS left out in X-copy
4wd:
Sorry. I really have to find the option for "notify me when a reply is posted".-questorfla (September 07, 2013, 09:53 PM)
--- End quote ---
You need to go to the full reply editor by clicking Preview.
Or figure out where they go when I get them.
--- End quote ---
I'll leave you to figure that one out ;D
Navigation
[0] Message Index
Go to full version