• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

  • 0
Sign in to follow this  

Mass copy of data for several folders.

Question

StrikedOut    180

I need to copy a large number of files that are stored in a single parent location but in their own folders to a single folder on another server (permissions are no issue). We have a CAD drawing register On a Spreadsheet and all the drawing folders are in a single parent location but in their own folders depending upon their design. Example, the parent folder is \\server\groupdata\shared\drawingregister and the files are in a folder, 0001 and the file is 0001.dwg. We are moving this to a cloud solution with a database backend and need to migrate the files to this server.

 

I have used - for /f %I in (images.txt) do Robocopy “Location” “Destination” %I - before with a list of images being listed in the text file and this works fine if all the images are stored in the same folder, but I cant get it to work in this manner. I have tried to modify the text file so each line has \0001\0001.dwg but nothig is copying. Is it possible to use robocopy like this or will I need to use an application to do this?

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
sc302    1,780

so you are trying to copy a specific file type with robocopy?  

 

try something like

 

robocopy source destination *.dwg /E /J /SEC /mt:20 /r:1 /log:%userprofile%\desktop\robocopy.log

 

This will copy all dwg files 

/e = all subdirectories including empty ones implies /s

/J = unbuffered I/O, best for large files

/SEC = copies all security settings

/mt:20 = mutli threaded copy, 20 files at a time (may have to adjust this, it likes 1 per core best)

/r:1 = 1 retry before failing

/log:%userprofile%\desktop\robocopy.log creating a log file somewhere (this should utilize your desktop folder to store the log file, can change as needed) so that /MT works as fast as it can.

 

 

robocopy /? can give you the official meanings for each switch, I put them into my own words.

Share this post


Link to post
Share on other sites
  • 0
sc302    1,780

After reading it again I may understand your question a bit better...I did a search and found this solution:

 

@echo off
set source="R:\Contracts"
set destination="R:\Contracts\Sites"

::Not sure if this is needed
::It guarantees you have a canonical path (standard form)
for %%F in (%destination%) do set destination="%%~fF"

for /r %source% %%F in (.) do if "%%~fF" neq %destination% ROBOCOPY "%%F" %destination% *.srt *.pdf *.mp4 *.jpg /COPYALL /R:0

 

  • Like 1

Share this post


Link to post
Share on other sites
  • 0
StrikedOut    180

Thanks sc302. I will take a look, hopefully tomorrow if things are not so busy and let you know if it works.

Share this post


Link to post
Share on other sites
  • 0
Sulphy    1,443

You could also try using DFS... i use it extensively to keep data replicated between Azure, Colorado, UK, & Massachusetts ... works pretty well, you can also set throttles, so you dont hammer the bandwidth!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.