Skip to content

Instantly share code, notes, and snippets.

@MaskeZen
Created January 15, 2018 15:32
Show Gist options
  • Save MaskeZen/f36b8af8947260d8e1e0573615ae8ae1 to your computer and use it in GitHub Desktop.
Save MaskeZen/f36b8af8947260d8e1e0573615ae8ae1 to your computer and use it in GitHub Desktop.
UsersBackup.bat
robocopy "C:\Users" "E:\backups\Users" /MIR /XA:SH /W:0 /R:1 /REG /XJ
@MaskeZen
Copy link
Author

/MIR : Mirror a directory tree - equivalent to /PURGE plus all subfolders (/E)
/XA:[RASHCNETO] : eXclude files with any of the given Attributes
/W:n : Wait time between retries - default is 30 seconds.
/R:n : Number of Retries on failed copies - default is 1 million.
/REG : Save /R:n and /W:n in the Registry as default settings.

File Attributes [RASHCNETO]

R – Read only
A – Archive
S – System
H – Hidden
C – Compressed
N – Not content indexed
E – Encrypted
T – Temporary
O - Offline

La opción /mir es equivalente a las opciones /e más /Purge con una pequeña diferencia de comportamiento:

  • Con las opciones /e más /Purge , si existe el directorio de destino, no se sobrescribe la configuración de seguridad del directorio de destino.
  • Con la opción /mir , si existe el directorio de destino, se sobrescribe la configuración de seguridad del directorio de destino.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment