Quantcast
Channel: File Services and Storage Forum
Viewing all articles
Browse latest Browse all 1766

Robocopy /MOVE switch

$
0
0

Hi all,

I have created a script to move home folders using Robocopy, on a Win 2008 R2 64bit server.  All our file servers are Win 2k8 R2 64bit.

The approach I have to move them effectively is as follows:

1)  Create \\FileServerB\ServerB$\User1 (this is the destination)
2)  Set Permissions on the above folder
3)  Run Robocopy \\FileServerA\ServerA$\User1 \\FileServerB\ServerB$\User1 /MIR /COPY:DATOU /MOVE /R:1 /W:1 /MT:128 /LOG+MyLog.log

It does a pretty good job in copying the files and folders (and subfolders), however, while I assume the source folder will be deleted, it actually behaves like this:

1)  If the source folder does not have subfolders, itself will be deleted after being copied.
2)  If the source folder contains subfolders, only files will be deleted.  So in the end it leaves the original empty folder structure in the source.

Is this the expected behaviour of the /MOVE switch??   I try not to add an RD \\FileServerA\ServerA$\User1 /s /q statement after that, in case if something goes wrong with that Robocopy instance, the source will not be deleted.

So what is the correct syntax/approach to achieve a clean and "robust" move of folders?


Thanks ahead.


Viewing all articles
Browse latest Browse all 1766

Trending Articles