• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Robocopy script

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

SMOKEU

Member
Joined
Nov 7, 2010
Location
NZ
I have 2 2TB drives, each with around 1.5TB of data on them. They are identical copies of each other, except the source drive has around 10GB of extra data on it. Everything else is the same. This is my script:

robocopy f:\ h:\ /e /mir /mt

I basically want to backup all my data, so I only have to make changes to drive F (either adding or removing data), and then let the script make an identical copy to drive H. When I run the script all it does it repeatedly echo (several times per second) this:

c:\users\chris\desktop > robocopy f:\ h:\ /e /mir /mt

It will keep echoing that line for many hours on end, and after a few hours I usually give up. I'm still running that script at the moment, and it's doing something because it's using up a fair bit of CPU time. Usually when the computer is idling the CPU usage is around 0-1% but when running this script it's around 10-15% CPU usage. The script has been running for around 8 hours now, and none of the new data from the source drive appears to have been copied.
 
If it is taking 10-15% CPU and there is no disk activity, the script is looping endlessly.

What happens if you run that command from a command line (cmd)?

According to the documentation, "mir" includes "e". You could try removing that option.
 
I tried my script by simply typing it into cmd.exe (which I ran as admin), and it works better than it did before (it's not stuck in the same endless loop), but now I'm having a different issue with it.

robocopy.jpg
 
I'm guessing you don't have access to that file. If you can add excluded folders, add the "System Volume Information" directory.
 
I'm guessing you don't have access to that file. If you can add excluded folders, add the "System Volume Information" directory.

I tried that and now I'm getting another access denied error on the DESTINATION drive. Here is my script:

robocopy f:\ h:\ /mir /mt /xd f:\"system volume information" h:\$recycle.bin

scripterror2.jpg
 
Looking at the "Exc Dirs" output, that doesn't seem to be parsing right, especially since it is trying to access the file. You may have to read up on how to format it. I have no experience with this program and Windows isn't even my main OS. ;)

I would try "f:\system volume information". It looks like the \" combo is escaping something it shouldn't and it is getting confused. Also, did you mean to put "h:\$recycle.bin"? The drive letter seems wrong.
 
I would try "f:\system volume information". It looks like the \" combo is escaping something it shouldn't and it is getting confused. Also, did you mean to put "h:\$recycle.bin"? The drive letter seems wrong.

I tried your first suggestion but I'm still getting the $recycle.bin error. I know that the drive letter seems wrong, but I'm excluding the directory exactly according to the cmd output.
 
The exclusion list, from my understanding, is used on the reading side. Otherwise, that doesn't make any sense. Try F instead. If it doesn't try to copy it, it won't fail.
 
The exclusion list, from my understanding, is used on the reading side. Otherwise, that doesn't make any sense. Try F instead. If it doesn't try to copy it, it won't fail.

I finally got it to work with no errors. This is my script:

robocopy f:\ h:\ /mir /mt /xd "f:\system volume information" "f:\$recycle.bin" "h:\$recycle.bin"

I really appreciate your help on this subject! I was thinking of making a "how to guide" on Robocopy scripts some time that I might put on here in a new thread. I just thought it might help other people instead of using third party backup software.
 
Back