Robocopy


Robocopy

Robocopy is a command line tool for copying and sincronizzazion and files and directories.
This tool helps you keep updated copies of files on computers and networks different and it is included in Microsoft Windows Resource Kit

Usage : ROBOCOPY source destination [file [file]…] [options]

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

Copy options:

  • /S : copy Subdirectories, but not empty ones.
  • /E : copy subdirectories, including Empty ones.
  • /LEV:n : only copy the top n LEVels of the source directory tree.
  • /Z : copy files in restartable mode.
  • /SEC : copy SECurity info (both source and dest must be NTFS).
  • /SECFIX : FIX SECurity info on existing files and dirs.
  • /TIMFIX : FIX TIMestamps on existing destination files.
  • /MOV : MOVe files (delete from source after copying).
  • /MOVE : MOVE files AND dirs (delete from source after copying).
  • /PURGE : delete dest files/dirs that no longer exist in source.
  • /MIR : MIRror a directory tree (equivalent to /E plus /PURGE).
  • /A+:[R][A][S][H] : add the given Attributes to copied files.
  • /A-:[R][A][S][H] : remove the given Attributes from copied files.
  • /CREATE : CREATE directory tree structure + zero-length files only.
  • /FAT : create destination files using 8.3 FAT file names only.

File Selection:

  • /A : copy only files with the Archive attribute set
  • /M : like /A, but remove Archive attribute from source files.
  • /IA:[R][A][S][H] : Include only files with some of the given Attributes set.
  • /XA:[R][A][S][H] : 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 | /XN | /XO : eXclude Changed | Newer | Older files.
  • /XX | /XL : eXclude eXtra | Lonely files and dirs.
  • /IS : Include Same 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.

(If n < 1900 then n = n days, else n = YYYYMMDD date).

Retry Options:

  • /R:n : number of Retries on failed copies: default is 1 million.
  • /W:n : Wait time between retries: default is 30 seconds.
  • /REG : Save /R:n and /W:n in the Registry as default settings.
  • /TBD : wait for sharenames To Be Defined (retry error 67).

Logging Options:

  • /L : List only – don’t copy, timestamp or delete any files.
  • /X : report all eXtra files, not just those selected.
  • /V : produce Verbose output, showing skipped files.
  • /NP : No Progress – don’t display % copied.
  • /ETA : show Estimated Time of Arrival of copied files.
  • /LOG:file : output status to LOG file (overwrite existing log).
  • /LOG+:file : output status to LOG file (append to existing log).

Example:

1. C:\windows\system32\robocopy.exe C:/Data E:/Backup /MIR /SEC

You clone the folder structure retaining the permissions and audit data, if you have them.
(Note, the switch /MIR delete files from destination folder, if they don’t longer exist in the source folder!)

2. C:\windows\system32\robocopy.exe “D:\doc” “F:\xarabas” /mir /np /log:c:\log.txt

You clone the “doc” folder structure, you don’t display % copied (/np option).
At the end the robocopy will create a log file on c:\log.txt

3. C:\windows\system32\robocopy.exe \\10.52.149.100\share\path \\10.50.11.95\share\path /MIR

You clone the shared folder from source server (10.52.149.100) to a shared folder in a destination server (10.50.11.95).

Note:

CopyRite XP by DaveSoft™ is a powerful new File Copy/Backup/Synch tool built to sit on top of Microsoft® RoboCopy.
CopyRite is a feature-rich system that has been designed to perform all Microsoft® RoboCopy functions in one system with an easy to use interface – all at an affordable price.

About these ads
  1. 8 April 2010 at 22:24

    nice info dude..
    good..

  2. Pete
    7 March 2012 at 00:08

    People should note that Robocopy is very sensitive about the time stamp. It’s best if copying to a server that you use GPO to make sure the time is synced up.

  3. 12 March 2012 at 16:30

    Buenos dias, pregunta concreta, Robocopy me sirve para clonar permisos SHARED o NO, ya que ni aun pasando la llave de registro LANMANSERVER\SHARED funciona

    gracias.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: