?
Solved

Robocopy /MT forcing /E even when you specify /S

Posted on 2011-10-10
12
Medium Priority
?
583 Views
Last Modified: 2014-01-17
Hi all. I'm using Robocopy in Win7 SP1. I'm migrating some PST files from one server to another. I do not want to create empty folders. It works perfectly via this command:

 

robocopy w:\ v:\ "*.pst*" /b /s /copyall /r:5 /w:10 /v /log:e:\robolog.txt

Open in new window


 

It behaves as it's supposed to by copying only the .pst files and not creating any empty folders where there are no PSTs. For example, let's say I have the following folder structure:

 
W:\ (root)

W:\folder1 <- has a PST file

w:\folder2 <- does NOT have a PST file

Open in new window


 

When issuing the command above, my destination ends up with Folder1 with the PST file and NOT Folder2, which had no pst files. Now, to speed things up, I'll throw in /MT:12 to run 12 threads:

 

robocopy w:\ v:\ "*.pst*" /mt:12 /b /s /copyall /r:5 /w:10 /v /log:e:\robolog.txt

Open in new window


 

It performs the file copies, but it creates all empty folders on the destination as if I had specified the /E switch instead of the /S switch. I am able to reproduce this on several machines and cannot figure out what's wrong. It's as if /MT forces /E. Is this by design or is there a way to get around this? Thanks!
0
Comment
Question by:HBSC
  • 5
  • 5
10 Comments
 
LVL 81

Expert Comment

by:arnold
ID: 36946705
Can you double check the log you've created to make sure that the /S switch you are using is not actually the source of the issue, i.e. the files are copied based on the pattern "*.pst" and the folders that get created are not empty. Do the folders that get created are empty on the source drive??

Use the /L and see what it actually would do without doing it.
0
 

Author Comment

by:HBSC
ID: 36948716
The folders that get created on the destination are not empty on the source, but they do not contain pst files. Historically with the /S switch, robocopy has treated source folders with no content matching the pattern as empty directories and did not create them on the destination. The behavior is still true if I omit the /MT switch and do a single threaded copy. It's only when I add /MT that it creates all folders. If I run the same command omitting /MT, I see expected behavior with only the folders that contain psts as being created on the destination.

0
 

Author Comment

by:HBSC
ID: 36948810
Sorry, I forgot to address your question about the log. I checked the logs for both /MT and no /MT. They appear to be identical:

Without MT (did not create extra empty folders):

   Source : w:\
     Dest : v:\becks2\

    Files : *.pst*
	    
  Options : /V /S /COPYALL /B /R:2 /W:1 

------------------------------------------------------------------------------

	  New Dir          0	w:\
	  New Dir          1	w:\akreci\
	    New File  		 976.5 m	archive.pst 100%  
	  New Dir          0	w:\akreci\!JPEGS (new)\
	  New Dir          5	w:\akreci\Archive_Old\
	    New File  		 145.8 m	AKRECI.PST 100%  
	    New File  		 1033216	AKRECI_Archive1.PST 100%  

Open in new window


   
With MT (created the entire folder structure):
Source : w:\
     Dest : v:\becks\

    Files : *.pst*
	    
  Options : /V /S /COPYALL /B /MT:64 /R:2 /W:1 

------------------------------------------------------------------------------

	                   0	w:\
	  New Dir          1	w:\akreci\
	    New File  		 976.5 m	archive.pst 100%  
	  New Dir          0	w:\akreci\!JPEGS (new)\
	  New Dir          5	w:\akreci\Archive_Old\
	    New File  		 145.8 m	AKRECI.PST 100%  
	    New File  		 1033216	AKRECI_Archive1.PST 100%  

Open in new window






0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 81

Expert Comment

by:arnold
ID: 36950412
note both create a !JPEGS directory

I do not know whether the change is windows 7 robocopy version.

Just checked the use of the /S in the same way you have and all the directories in source are created.
0
 

Author Comment

by:HBSC
ID: 36950695
Yes, the log shows that it's creating the !JPEGS folder on both commands. The folder is not actually created on the singlethreaded run, though. I'll run another test and show the output.

I created a test folder structure. Four folders, two with text files, one folder empty, and one folder with a pst:

E:\1.source>dir /s /b
E:\1.source\1.miscfiles
E:\1.source\2.empty
E:\1.source\3.pst
E:\1.source\4.miscfiles
E:\1.source\1.miscfiles\blah.txt
E:\1.source\1.miscfiles\lkjasdfl.txt
E:\1.source\1.miscfiles\stuff.txt
E:\1.source\3.pst\dummy.pst
E:\1.source\4.miscfiles\blah.txt
E:\1.source\4.miscfiles\lkjasdfl.txt
E:\1.source\4.miscfiles\stuff.txt

Open in new window


Singlethreaded robocopy:

   Source : E:\1.source\
     Dest : E:\2.dest.st\

    Files : *.pst

  Options : /V /TEE /S /COPYALL /B /R:1000000 /W:30

----------------------------------------------------------------------

                           0    E:\1.source\
          New Dir          0    E:\1.source\1.miscfiles\
          New Dir          0    E:\1.source\2.empty\
          New Dir          1    E:\1.source\3.pst\
100%        New File              12.1 m        dummy.pst
          New Dir          0    E:\1.source\4.miscfiles\

----------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         5         4         1         0         0         0
   Files :         1         1         0         0         0         0
   Bytes :   12.15 m   12.15 m         0         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00

E:\>dir 2.dest.st /s/b
E:\2.dest.st\3.pst
E:\2.dest.st\3.pst\dummy.pst

Open in new window


Multithreaded:
   Source : E:\1.source\
     Dest : E:\2.dest.mt\

    Files : *.pst

  Options : /V /TEE /S /COPYALL /B /MT:2 /R:1000000 /W:30

------------------------------------------------------------------------------

                           0    E:\1.source\
          New Dir          0    E:\1.source\1.miscfiles\
          New Dir          0    E:\1.source\2.empty\
          New Dir          1    E:\1.source\3.pst\
100%        New File              12.1 m        dummy.pst
          New Dir          0    E:\1.source\4.miscfiles\

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         5         4         1         0         0         0
   Files :         1         1         0         0         0         0
   Bytes :   12.15 m   12.15 m         0         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00

E:\>dir 2.dest.mt /s/b
E:\2.dest.mt\1.miscfiles
E:\2.dest.mt\2.empty
E:\2.dest.mt\3.pst
E:\2.dest.mt\4.miscfiles
E:\2.dest.mt\3.pst\dummy.pst

Open in new window


The logs show the exact same output, yet the singlethreaded is performing as expected with /S and does not create empty folders based on the specified file pattern. The multithreaded is creating all folders on the destination, including the empty folder on the source. I just ran the same scenarios using the robocopy.exe packaged with 2008 R2 Datacenter, and I get the same results.
0
 
LVL 81

Expert Comment

by:arnold
ID: 36951422
I do not understand what you are saying both options have these entries:
         New Dir          0    E:\1.source\1.miscfiles\
          New Dir          0    E:\1.source\2.empty\
          New Dir          0    E:\1.source\4.miscfiles\
0
 

Author Comment

by:HBSC
ID: 36951435
Right, that's what the log shows. The end result is that they are not actually copied, contrary to what the log says. After the single threaded robocopy finished, the destination folder contained the following:

E:\>dir 2.dest.st /s/b
E:\2.dest.st\3.pst
E:\2.dest.st\3.pst\dummy.pst

One folder and one pst file, as expected from the /S command. The multithreaded destination folder contained the following:

E:\>dir 2.dest.mt /s/b
E:\2.dest.mt\1.miscfiles
E:\2.dest.mt\2.empty
E:\2.dest.mt\3.pst
E:\2.dest.mt\4.miscfiles
E:\2.dest.mt\3.pst\dummy.pst

A full copy of the source folder structure.
0
 
LVL 81

Accepted Solution

by:
arnold earned 2000 total points
ID: 36952552
It just how the threaded version option works.
0
 

Assisted Solution

by:HBSC
HBSC earned 0 total points
ID: 36952564
So you're saying single threaded observes /S whereas multithreaded ignores it by design on the exact same copy operation?
0
 
LVL 81

Expert Comment

by:arnold
ID: 36952838
That is what your experience and my attempt confirms.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

VM backups can be lost due to a number of reasons: accidental backup deletion, backup file corruption, disk failure, lost or stolen hardware, malicious attack, or due to some other undesired and unpredicted event. Thus, having more than one copy of …
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Suggested Courses

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