in

RoboCopy: The Definitive Guide

robocopy

Robocopy is one of the most-utilized order line utilities to duplicate or copy huge volumes of data information in Windows.

It is such a famous apparatus due to how ground-breaking it is. However, with all that force comes unpredictability.

In this guide, we are going to separate such intricacy and give a total instructional exercise on utilizing this valuable tool.

What is Robocopy?

Robocopy is a Windows order line utility that has been accessible since Windows NT.

It is a substitution to the less flexible xcopy utility. It permits you to indicate a path or server way to duplicate/move records to at an order brief.

Some of the known features are:

  • It can copy files over a network with resume facilities
  • It can make a copy of a file and directory characteristics conserving timestamps
  • Robocopy can copy files in backup mode to safeguard files that are copied. It also includes those who have been denied to the supervisor
  • It can also sync 2 folders
  • Robocopy can copy paths larger than the 256-character path threshold

Robocopy Commands

Source Source directory (drive:\path or \\server\share\path).
Destination Destination directory (drive:\path or \\server\share\path).
File File(s) to copy (names/wildcards: default is “*.*”).

Copy Options

/S Copy subdirectories, but not the empty ones.
/E Copy subdirectories, including the empty ones.
/LEV:n Only copy the top n levels of the source directory tree.
/Z Copy files in restartable mode.
/B Copy files in backup mode.
/ZB Use restartable mode. If access denied, use backup mode.
/EFSRAW Copy all encrypted files in EFS RAW mode.
/COPY:copyflag[s] What to COPY for files (default is /COPY:DAT). (copyflags : D=Data, A=Attributes, T=Timestamps). (S=Security=NTFS ACLs, O=Owner info, U=aUditing info).
/DCOPY:T COPY the directory timestamps.
/SEC Copy files with security (equivalent to /COPY:DATS).
/COPYALL Copy all file info (equivalent to /COPY:DATSOU).
/NOCOPY Copy no file info (useful with /PURGE).
/SECFIX Fix file security on all files, even skipped files.
/TIMFIX Fix file times on all files, even the skipped ones.
/PURGE Delete dest files/dirs that no longer exist in the source.
/MIR Mirror a directory tree (equivalent to /E plus /PURGE).
/MOV Move files (delete from the source after copying).
/MOVE Move files and dirs (delete from the source after copying).
/A+:[RASHCNET] Add the given attributes to copied files.
/A-:[RASHCNET] Remove the given attributes from copied files.
/CREATE Create directory tree and zero-length files only.
/FAT Create destination files using 8.3 FAT file names only.
/256 Turn off very long path (> 256 characters) support.
/MON:n Monitor source; run again when more than n changes seen.
/MOT:m Monitor source; run again in m minutes time, if changed.
/RH:hhmm-hhmm Run hours – times when new copies may be started.
/PF Check run hours on a per file (not per pass) basis.
/IPG:n Inter-packet gap (ms), to free bandwidth on slow lines.
/SL Copy symbolic links versus the target.
/MT[:n] Do multi-threaded copies with n threads (default 8). n must be at least 1 and not greater than 128. This option is incompatible with the /IPG and /EFSRAW options. Redirect output using /LOG option for better performance.

File Selection Options

/A Copy only the files with the archive attribute set.
/M Copy only the files with the archive attribute and reset it.
/IA:[RASHCNETO] Include only the files with any of the given attributes set.
/XA:[RASHCNETO] Exclude files with any of the given attributes set.
/XF file [file]… Exclude files matching given names/paths/wildcards.
/XD dirs [dirs]… Exclude directories matching given names/paths.
/XC Exclude changed files.
/XN Exclude newer files.
/XO Exclude older files.
/XX Exclude extra files and directories.
/XL Exclude lonely files and directories.
/IS Include same files.
/IT Include tweaked files.
/MAX:n Maximum file size – exclude files bigger than n bytes.
/MIN:n Minimum file size – exclude files smaller than n bytes.
/MAXAGE:n Maximum file age – exclude files older than n days/date.
/MINAGE:n Minimum file age – exclude files newer than n days/date.
/MAXLAD:n Maximum last access date – exclude files unused since n.
/MINLAD:n Minimum last access date – exclude files used since n. (If n < 1900 then n = n days, else n = YYYYMMDD date).
/XJ Exclude junction points. (normally included by default).
/FFT Assume FAT file times (2-second granularity).
/DST Compensate for one-hour DST time differences.
/XJD Exclude junction points for directories.
/XJF Exclude junction points for files.

Monitoring Options

/R:n Number of retries on failed copies
/W:n Wait time between retries
REG Save /R:n and /W:n in the Windows registry as default settings
/RH:hhmm-hhmm Times when new copies can be started
/TBD Wait for sharenames to be defined
/PF Check run hours on a per file (not per pass) basis
/MON:n Run again when more than n changes seen
/MOT:m Run again in m minutes, if changed

Robocopy Examples

Ex- robocopy c:\hope c:\hope2 *.txt

Ex- robocopy c:\hope c:\hope2

With this the robocopy command can copy all files in the hope directory to the hope2 directory. With this any .txt file can be easily copied from the hope directory into the hope2 directory.

Ex- robocopy c:\hope c:\hope2 /e

Ex- robocopy c:\hope c:\hope2 /MIR

With this Robocopy example all files and folders even the empty ones can be copied from the hope directory to the hope2 directory.

With the above example you can mirror files in c:\hope into c:\hope, even purge any files in the hope2 directory.

Download Robocopy

Although Robocopy is already available in Vista and Windows 7 by default. For Server 2003 and Windows XP, you can easily download it from the link below.

So, as it already comes by default, the command line utility tool is free of cost as well.

Link 1:

https://www.microsoft.com/en-us/download/details.aspx?id=17657

Link 2:

https://www.microsoft.com/en-za/download/confirmation.aspx?id=17657

How to use Robocopy?

As an incredibly flexible program, Robocopy is frequently used to move files over a system.

So, here is a fast guide on the best way to use program. The assignment is a two-step procedure.

Users should initially empower document sharing on the source PC.

At that point utilize the Robocopy in the goal device to move files over the system.

The detailed steps are as follows:

First: Set Up file sharing on the source PC

  1. Go to ‘File Explorer’ and look for the folder you want to share
  2. Right click on the folder and click on ‘Properties’
  3. Now click on Sharing and Share later
  4. From the drop-down menu select ‘Everyone’
  5. Select ‘Add’
  6. Next select the type of sharing permissions for the folder
  7. Then select ‘Share’ to continue
  8. Now just note the network path of the folder so that other users can easily access the sharing files over the network.
  9. Click Done

Simply wait for the sharing progress to be completed and later close.

Second: Utilize Robocopy in the end device to copy files

When document sharing is effectively arranged on the source PC, you can duplicate sharing records utilizing Robocopy in the goal device.

Let’s take a closer look about the steps to use Robocopy in Windows.

  1. First you need to click Windows logo key + X at the same time.
  2. Next select Command Prompt from the list
  3. Now type the below command and press enter.

robocopy \\source-device-ip\path to share folder C:\destination-device\path to store folder /S /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:16

Robocopy vs Xcopy

Robust File Copy (Robocopy) and XCopy are two order line devices regularly utilized to move document for Windows.

XCopy on the other hand is for most forms of Windows, however, has been less utilized as Robocopy is disseminated with the two Windows Vista and Windows 7.

Robocopy is likewise part of the Windows Resource Kit. For a wide range of mass record duplicating, both are valuable projects, yet Robocopy has a few choices that make the activity simpler.

Mirroring on Robocopy

Robocopy, unlike XCopy, is utilized to mirror — or synchronize — registries.

Rather than replicating the entirety of the records starting with one directory then onto the next, Robocopy will also check the goal index and expel documents no longer in the principle tree.

It likewise checks the documents in the destination directory against the records to be copied and does not sit around idly replicating unaltered records.

Attributes

Both XCopy and Robocopy have support for replicating over the “archive” characteristic on records, yet Robocopy makes this a stride further — it underpins duplicating over all qualities — including timestamps, security, proprietor, and evaluating data. These extra characteristics help in keeping up a legitimate registry structure, particularly when replicating as a director.

Conclusion

So, this article gives a nitty gritty prologue to Robocopy in Windows 10.

While it is anything but difficult to consider Robocopy an instrument for replicating documents from Point A to Point B, it can likewise be utilized for movements.

Robocopy has the capacity for instance, to screen a hotspot for changes and afterward duplicate those progressions to a goal.

While there are as a matter of fact some outsider apparatuses that truly take the duplicate procedure to the following level, Robocopy is an amazing tool on the off chance that you need to adhere to utilizing local devices.

GeekyGuy

Written by GeekyGuy

Geeky Guy is inspired by innovative technology taking shape around the world and this is what motivate him to start Geek After Hours, a tech blog featuring how to guides about computer, laptops, mobiles, software, and gadgets. He also like to write reviews about technology products with an aim to help you make better buying decisions.