Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: ROBOCOPY - Create Backup Script

28 Oct 2012   #140

Win 7 x64
How to use ROBOCOPY AFTER manually backing up


Great thread on robocopy.

I have a NAS and manually copied over the files. I now want to use robocopy.

I am wary of using robocopy as my backup tool as I have some thoughts which may cause issues:

1) The datetime on the folders and files on the NAS are when I did the manual copy, not the source attributes, and so if I use the robocopy /MIR I am not sure what will happen.

How should I sync the NAS folder/files attributes back to the source with robocopy so I can use /MIR successfully?

Basically asking what should be the steps if a person used to copy folders manually and NOW wants to use robocopy? You guide seems to be for first time use and some points on how to transition from a manual process would be great.

2) Also, I have a number of source folders from many machines which I copy to ONE folder on the NAS. That is, all sub folders from multiple sources go to ONE folder on the NAS, which essentially is all the source sub folders under one folder on the NAS.

I want to be able to mirror the source locations to a "merged" single destination folder and only copy over changes.

Is that possible with robocopy?


My System SpecsSystem Spec
28 Oct 2012   #141
Microsoft MVP

Windows 7 Ult. x64


I'm not sure what would happen transitioning from manual copy to robocopy - all I can suggest is to setup a simple test case and experiment with that.

For the merged location, you can do that. This is what I have:

robocopy E:\Music G:\General_Backup\Music /e /mir /mt:8 /R:3 /W:3
robocopy E:\Photo's G:\General_Backup\Photo's /e /mir /mt:8 /R:3 /W:3
robocopy F:\Keys G:\General_Backup\Keys /e /mir /mt:8 /R:3 /W:3
Again, its best to put a small test case together and check how it works.

My System SpecsSystem Spec
04 Nov 2012   #142

Windows 7 Home Premium SP-1, 64-bit
/MIR is perfectly safe, does not delete files from source

Quote   Quote: Originally Posted by Golden View Post
Use the /MIR option with caution - it has the ability to delete a file from both the source and destination under certain conditions.

This typically occurs if a file/folder in the destination has been deleted, causing ROBOCOPY to mirror the source to the destination. The result is that the same files in the source folder are also deleted. To avoid this situation, never delete any files/folders from the destination - delete them from the source, and then run the backup to mirror the destination to the source.

If in doubt, do not use the /MIR option, but be aware that backups will take longer.
For benefit of anyone following this tutorial: this section is incorrect. I checked with knowledgeable MS sources, and I and others tested this extensively.

/MIR is perfectly safe to use. /MIR does not delete files from source, ever. Even if you manually delete files from destination, /MIR will not delete files from source.

In fact, the only time Robocopy deletes files from source is if you use the /MOV option to move files, (which deletes from source after copying).

Please correct this otherwise good tutorial to remove the false warning about the useful /MIR option.
My System SpecsSystem Spec
04 Nov 2012   #143
Microsoft MVP

Windows 7 Ult. x64

If you type robocopy /? at a command prompt you will see that:

/mir is the same as performing /purge and /e

Have a look at what the /purge option does.
My System SpecsSystem Spec

04 Nov 2012   #144

Windows 7 Home Premium SP-1, 64-bit

I'm well aware that /MIR = /PURGE + /E. That will never delete files from source.

Quote   Quote: Originally Posted by Microsoft Technet
/PURGE : Deletes destination files and directories that no longer exist in the source.
That means that Robocopy will delete files from destination, if you have deleted them from source.

Neither /PURGE nor /MIR will delete files from source. Please test it, you'll see.
My System SpecsSystem Spec
04 Nov 2012   #145

Windows 7 Ultimate x64

Great write up robocopy is pretty powerful.
My System SpecsSystem Spec
07 Nov 2012   #146

Windows 7 professional 64-bit

First, congrats and thanks for the good article!
Now letís get to my problem.
I tried to set up a back up strategy. When I tried the syntax directly in CMD there is no problem, and the files are copied properly. But when I try to set up a .bat file, the program does not run (it starts, but it does not finish, nor initialize). The file is located on my desktop.
Iíve attached a picture of cmd when I start the robo.bat file.

Here is the syntax:
robocopy d:\diploma d:\programi\dropbox\diploma /s /np /tee /log:d:\diploma\robo.txt

What am I doing wrong?


Attached Thumbnails
ROBOCOPY - Create Backup Script-robocopy.jpg  
My System SpecsSystem Spec
07 Nov 2012   #147

Windows 7 Home Premium SP-1, 64-bit

Try running the .bat as Administrator (a right-click command).
My System SpecsSystem Spec
07 Nov 2012   #148

Windows 7 professional 64-bit

Already tried, same resultÖ
My System SpecsSystem Spec
07 Nov 2012   #149

Windows 7 Home Premium SP-1, 64-bit

Are you able to run other .bat files from that location? (e.g. .bat files that aren't running Robocopy?)
My System SpecsSystem Spec

 ROBOCOPY - Create Backup Script

Thread Tools

Similar help and support threads
Thread Forum
Robocopy Script For Incremental, Differential and Full Backup
Dears, Anobody can help me to have a backup script that will help for backup requirement, Please see the details below My Source Directory is "D:\Source" My Destinationa Directory is "\\Server\Destination" I need to meet the following (1) Need to take fullbackup on every Friday ? For this...
General Discussion
my backup script using robocopy
robocopy /S /E /MOV %USERPROFILE%\Documents\ G:\backup\Documents\ robocopy /S /E /MOV %USERPROFILE%\Pictures\ G:\backup\Pictures\ robocopy /S /E /MOV %USERPROFILE%\Downloads\ G:\backup\DownloadS\ robocopy /S /E /MOV %USERPROFILE%\Favorites\ G:\backup\Favorites\ robocopy /S /E /MOV...
Backup and Restore
robocopy script is not working through Scheduler
Dear All, My batch file of robocopy is working fine. But when I tried to run it through task scheduler, none of the files transfer to the target location. @echo off echo +-----------------------------------------+ echo Database Export Utility for server ...
General Discussion
Robocopy backup for personal folders
I have created a batch file for copying my Documents folder to an external hard drive: The log file shows that it is backing up C:\users\USERNAME\documents\My Music and C:\users\USERNAME\documents\My Pictures. That's fine, because I want those backed up anyway, but when I go to...
Backup and Restore
Anyone use robocopy to backup?
Evening all, Just curious to know if anyone uses the built in utility to backup software on your machine, im trying to backup my itunes folder to an external HD but having a few issues to get this to work properly! I also use sync toy for backing up but just really want to know what everyone...
Backup and Restore

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 19:40.
Twitter Facebook Google+