Copying lots of files

12 01 2011

So, I had to copy a lot of files from my external HDD to my local HDD. Lot = 1.2 million files. The thing was in some folder hierarchy and obviously I wanted to preserve all that stuff. Problems

  1. Not safe to “move” because in case my experiments go awry, I still want the data to stay on the external HDD. So only looking at copy options.
  2. Default right click copy-paste was kind of slow. Or maybe it isn’t, but lets just assume it is.
  3. move and copy will on Windows will not work for directories

Solution – XCOPY
Create a folder INTO which you want the contents to come. cd into that folder. Then type

xcopy <path to directory whose contents will get copied. NOTE contents within this dir will be copied> /e /d

Notice the two switches e and d. e forces all directories that do not exist to be created – even if its empty on the external HDD. d is a trick 🙂 In case you decide to stop the process and carry on later, just Ctrl-C. Later, run the same command again – with /e and /d and copying will resume exactly where it left off. Dont worry about Ctrl-C cutting a large file and that file getting partially copied. It will be deleted on Ctrl-C and will resume from the beginning next time.

EDIT: If you have a LOT of files, it takes a LOT of time to resume coz it needs to check a LOT of files.




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: