Robocopy C:\Folder1 C:\Folder2 /MIR /dcopy:T
To copy a directory using /IPG to limit bandwidth usage. General rule of thumb /IPG:750 will use roughly 1Mbps.
Robocopy /ipg:750 /z /r:3 /w:3 /tee /LOG+:c:\robolog.txt //server1/share //server2/share
Robocopy Options and Switches:
Here is a scenario/issue:
"I have a shared folder on one server that some users accessed today. Some data was created, deleted and altered.
They should have been using a share on another server, so my problem is how do I use ROBOCOPY to merge the two? Can you please help me out with the syntax?
I'm not so sure about using the /mir switch as I really do not want data deleted on the destination folder!!"
Does anyone know the solution? Thanks!
/mir has this problem, of mirroring what it finds and then what id does not find. So if a file was mirrored and the other day it was removed by mistake from the source, it will be mirrored (deleted) on the destination.
I think /mir would be a solution for you by removing the modify premission from the folder where /mir will be used (on the source of course).
I would be a good idea to be one the safe side to have another robocopy without the mir of the destination to a third destination.
what are extra files?
According the the options shown here:
/xx Excludes extra files and directories. Extra files are files that exist in the destination directory.
/x Reports all extra files, not just those that are selected.
So, I assume that extra files (and folders) are:
Files (and folders) that exist at the copy-destination, but do not exist at the copy-source.
What's up with example #3? /S is defined as, "copy Subdirectories, but not empty ones." Doesn't seem like an appropriate copy option to use, given the intent in the example.
Are you sure /S is the correct option for example #3???
I used Robocopy with the /mir switch to copy data from a folder on one server to a folder on another but found I had to add the /copyall and /dcopy:T switches to get a true mirror of source, i.e including security setting and timestamps on folders. Interesting as I originally tried to copy using the /e switch along with /copyall but that failed to copy the security settings.
Conclusion: use /mir /copyall /dcopy:T with Robocopy to get a true copy of source data to destination.
The syntax summary says "robocopy <Source> <Destination> [<File>[ ...]] [<Options>]" but the "File" option is not further documented, there is no example, and I can't get it to work
Thanks for this nice article
I'm interested in an incremental copy , i.e. copy from sourcedir, all files, sub directories, contents inside sub dir, sub sub dir .... upto multiple levels of sub dir, to dest dir withOUT deleting any additional files found in dest dir ..
- All changed files need to be copied....
- all new files need be copied...
- un changed files (time stamp, size, location) should be left un touched [but even IF they are copied over, that's ok]
/MIR would NOT help me as that would delete missing files
could some one please post the correct syntax
please assume source directory as c:\sourcedir and destination as d:\destdir
thanks in advance