Robocopy source folder and all subfolders
-
I'm looking to use robocopy to copy over a network share drive. For some reason I can't find a way to copy over the source file and all of its subfolders. This is the command I am running from the destination server:
Robocopy “\titus\TestIT” “E:\File Shares” /MIR /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log
This will only copy the subfolders and everything in them and not the actual "TestIT" folder. I can create a TestIT folder on the destination and then manually share it through appropriate groups in AD, but I know I'm missing something simple.
-
Try something like this:
robocopy F:\source\TestIT \\destination\d$\DIR\ /MIR /FFT /R:3 /W:10 /Z /NP /NDL /LOG+:\\logLocation\log.txt
Note above:
SOURCE first
DESTINATION second -
Robocopy “\titus\TestIT” “E:\File Shares” /MIR /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log
Oh that's weird. It's leaving out my second "\"
This is what I actually run:
Robocopy “\\titus\TestIT” “E:\File Shares” /MIR /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log -
@markferron said in Robocopy source folder and all subfolders:
Robocopy “\titus\TestIT” “E:\File Shares” /MIR /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log
Oh that's weird. It's leaving out my second "\"
This is what I actually run:
Robocopy “\\titus\TestIT” “E:\File Shares” /MIR /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.logOkay that makes more sense.
Try this:
"\\titus\TestIT" "E:\File Shares\TestIT" /MIR /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log
-
Does that command preserve permissions and all that to?
-
@dafyre said in Robocopy source folder and all subfolders:
Does that command preserve permissions and all that to?
If you want to do that, the /copyall switch does it.
-
@tim_g Oh wow I didn't realize that it would create the file for you.
Works well. I just have to manually share the file and give AD groups the correct Permissions (Sharing tab) under Advanced Sharing. It also still retains the correct permissions under Security as well.I'm going to leave out /V and /TEE and add in /NP /NDL since there is a log at then end. Seems like a waste of energy (also seemed to run faster in my tests).
-
@markferron said in Robocopy source folder and all subfolders:
I'm going to leave out /V and /TEE and add in /NP /NDL since there is a log at then end.
Yeah I use /NP and /NDL and LOG+
-
One more question. I'm going to add multi-threading to make it run fast (/MT) and the machine I'm running this command on (which is the destination machine) is a virtual machine. Is there a correlation with number of threads to CPU core count or RAM?