[Webinar] Streamline your web hosting managementRegister Today


Robocopy and the /MIR parm

Posted on 2008-02-06
Medium Priority
Last Modified: 2012-05-05
In using Robocopy I would like to use the /MIR parm.  I wanted to make sure I understood the effect of this parm before using it.


I am anticipating that this command will copy all files and subdirectories to the folder ABSFILER_DATAPACK and that subsequent running of this command will refresh the files and subfolders under ABSFILER_DATAPACK so that they are an exact copy of F: at the time the command was run.

The primary thing I want assurance on is this:  We have other folders on \\NASHABS-NAS01\DATAPACK besides \ABSFILER_DATAPACK.  I do not want to impact these other folders at all.  I just want to affect the stuff stored under \ABSFILER_DATAPACK.

This command will be running under a Windows 2000 Server OS and copying files to a Windows 2003 NAS.

Thanks,  Rich
Question by:RichNH

Expert Comment

ID: 20833094
Set up a fake directory tree with fake files and try it out.
LVL 86

Accepted Solution

oBdA earned 200 total points
ID: 20836390
Yes, that will do what you want; the ABSFILER_DATAPACK folder will be an exact replica of the F: drive.
And you need to separate the arguments with spaces; the above will end in a parameter error; use it like this:
You might want to reduce the waiting time to 1 second (or even 0), and the retries can probably be lowered as well, assuming \\NASHABS-NAS01 can be reached through a reliable LAN connection. Otherwise, if a file is open and can't be accessed at the moment, robocopy will try for 150 seconds just for this single file, and probably won't be able to copy it anyway. The retry/wait options are more useful for unreliable links.
LVL 21

Expert Comment

ID: 20844447
Robocopy does not accept things such *.*

So your command would be like this
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

LVL 86

Expert Comment

ID: 20844865
please run at least "robocopy /?" before making bold statements like yours:
              Usage :: ROBOCOPY source destination [file [file]...] [options]

             source :: Source Directory (drive:\path or \\server\share\path).
        destination :: Destination Dir  (drive:\path or \\server\share\path).
               file :: File(s) to copy  (names/wildcards: default is "*.*").

Not to mention that the /S in your line is not necessary, as /S is a subset of /E:
               /MIR :: MIRror a directory tree (equivalent to /E plus /PURGE).
LVL 21

Expert Comment

ID: 20848597

Firstly my apologies. To be fair, I was at home and didn't have access to RoboCopy even though I do use it extensively with the mirror option.  But at one stage Robocopy never allowed *.* . I think it was NT4 version  and as a result I've always never used it like that! I guess I should RTFM

Apologies once again.
LVL 86

Expert Comment

ID: 20848624
I think that was even in the NT4 version; the syntax always required source and destination folders as the (mandatory) first two arguments (unless used with /nodd or /nosd), and any arguments following without switch would be considered files or file masks to copy.
In fact, it even "inserts" *.* into the command line by itself if no files are specified.

C:\>robocopy c:\test c:\temp /l
   ROBOCOPY     ::     Robust File Copy for Windows     ::     Version XP010
  Started : Fri Feb 08 00:18:28 2008
   Source : c:\test\
     Dest : c:\temp\
    Files : *.*
  Options : *.* /L /COPY:DAT /R:1000000 /W:30

Open in new window


Author Closing Comment

ID: 31428496
Thank you all for the feedback.  I have to state that I LOVE ROBOCOPY!  

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

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

Many admins will agree: WSUS is is a nice invention but using it on the client side when updating a newly installed computer is still time consuming as you have to do several reboots and furthermore, the procedure of installing updates, rebooting a…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
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…

612 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