Robocopy
 

MegaSack DRAW - This year's winner is user - rgwb
We will be in touch

[Closed] Robocopy

18 Posts
10 Users
0 Reactions
126 Views
Posts: 578
Free Member
Topic starter
 

I want to create a mirror image of my mp3 directory on an external drive. I use windows 10. If I run robocopy /MIR <source> <destination> I believe that will do what I want. However, when I add new directories to the source and run the same robocopy command again in a couple of weeks, will it just add the new or changed files to the destination or will it go through the whole 100% copying process again?
I'm aware that this method will also purge the destination of any deleted directories on the source, which is fine.
So do I need to add any more switches to the command for adding new files only, or just the original command?
TIA


 
Posted : 22/09/2016 11:21 am
Posts: 0
Free Member
 

More switches, /s at the least I think, unless /mir does that I can't remember.
[url= https://technet.microsoft.com/en-us/library/cc733145(v=ws.11).aspx ]RT(F)M[/url] 😉


 
Posted : 22/09/2016 11:53 am
Posts: 0
Free Member
 

That command should work. It will compare the filenames and timestamps, if they match, then those files will be skipped.

Note there can be issues if copying to different filesystems, as the timestamps are inaccurate, so all files are detected as newer. So you can use Robocopy with the /FFT option, which fixes this.

The /MIR option includes subdirectories anyway, so you don't need /E.


 
Posted : 22/09/2016 11:54 am
Posts: 578
Free Member
Topic starter
 

That's good news, thanks. Same file system so no problem there.


 
Posted : 22/09/2016 12:04 pm
Posts: 0
Free Member
 

Have you looked at using SyncToy, it's much easier to set up.


 
Posted : 22/09/2016 12:54 pm
Posts: 0
Full Member
 

Have you looked at using SyncToy, it's much easier to set up.
Anther vote for SyncToy if you're trying to keep two folders regularly synced rather than a one off copy.


 
Posted : 22/09/2016 1:39 pm
Posts: 0
Free Member
 

Robocopy is easy enough, once you figure out what you want to do.
You can save the command as a batch file, then run it whenever you like. Or add it to scheduled tasks, to run automatically.


 
Posted : 22/09/2016 1:46 pm
Posts: 578
Free Member
Topic starter
 

Thanks again. The idea was to try not to use third party software if Windows can already do it. I've got Karen's Replicator which is probably similar to the software mentioned above, but you know, if it's already there... It will be in a bat file but not scheduled. I'll decide when it needs running. Cheers all.


 
Posted : 22/09/2016 2:25 pm
Posts: 1282
Free Member
 

Iirc /mir is the same as /e /purge. So you do not need /s but you could do /s /purge if you want to ignore empty directories.


 
Posted : 22/09/2016 3:32 pm
Posts: 0
Free Member
 

A word of caution, /MIR works both ways so make sure you don't mix up your source and destination!

Better off not using MIR altogether in my opinion.


 
Posted : 22/09/2016 4:08 pm
Posts: 0
Free Member
 

The idea was to try not to use third party software if Windows can already do it.

SyncToy is a Microsoft tool, available for free download from their website.


 
Posted : 22/09/2016 10:29 pm
Posts: 578
Free Member
Topic starter
 

Noted chojin, thanks.

SyncToy - I can see what it does, it's just the 1Kb .bat file compared to a 4Mb GUI seems a much more preferable option to me. I'm no purist (I'm on Windows 10 after all), it's just the way I want to do things and when I show the kids what it does, they can learn a bit more along with me...


 
Posted : 23/09/2016 7:01 am
Posts: 578
Free Member
Topic starter
 

And no one's made a Robocop joke yet, disappointed.


 
Posted : 23/09/2016 7:04 am
Posts: 167
Free Member
 

I use Robocopy to do the same but I'm very wary of using /MIR. What happens if you have a corruption in the target destination? Will it then delete the corresponding source files?

I think I just use /S and the retry options /R:3 /W:3.

So each time I run the command via a batch file, it checks the whole directory structure and only copies new files in the source.

Also you can play with multi-threaded copies to see if that speeds up copying at all. It may not.

/MT[:n] :: Do multi-threaded copies with n threads (default 8).


 
Posted : 23/09/2016 7:37 am
Posts: 0
Free Member
 

Just remember, if you do use Robocopy then you'll only have 10 seconds to comply


 
Posted : 23/09/2016 7:39 am
Posts: 167
Free Member
 

Just remember, if you do use Robocopy then you'll only have 10 seconds to comply

Here's the switches for that 😉

/R:1
/W:10


 
Posted : 23/09/2016 7:49 am
Posts: 167
Free Member
 

Here we go...this is what I use. I guess I don't need the /E

ROBOCOPY D:\Documents x:\Backup /S /E /R:3 /W:3 /MT:20


 
Posted : 23/09/2016 6:21 pm
Posts: 8780
Full Member
 

You're all pretty smart, huh. Think you could outsmart a bullet?


 
Posted : 23/09/2016 6:55 pm
Posts: 0
Free Member
 

The OP made a mistake, now it's time to erase that mistake


 
Posted : 23/09/2016 7:32 pm