A Complete Guide to Robocopy - learnit

Home Top Ad

Post Top Ad

Tuesday, August 30, 2022

A Complete Guide to Robocopy

A Complete Guide to Robocopy

Robocopy is a powerful command-line tool for Windows that allows users to synchronize files and folders from one location to another. Learn more about everything you can do with Robocopy here.


Robocopy stands for “Robust File Copy.” It is a powerful (and potentially scary) command-line utility to copy or move files from one place to another. It is a favorite amongst many IT Pros, mostly due to its overwhelming number of useful features and switches


It was built to be more robust (hence the name) than Xcopy or the original copy command. Robocopy was first released with the Windows NT 4.0 Resource Kit (!). It has been a standard ‘feature’ in Windows since Windows Vista and Windows Server 2008.


What’s the difference with XCopy?

The biggest difference between Robocopy and Xcopy is the bewildering number of features, switches, flags, etc. There have also been several performance enhancements to Robocopy, making it a more pseudo-like backup utility compared to Xcopy


Why use Robocopy instead of PowerShell?

Although you inherently get a lot of power in using PowerShell to handle the same basic copy/move file tasks mentioned here, again, the number of options available to you with Robocopy makes it the perfect choice if you want to handle file copy tasks efficiently and safely. Robocopy is a wonderful option for new file server creation and migration projects as well.


/s Copies subdirectories. This option automatically excludes empty directories.
/e Copies subdirectories. This option automatically includes empty directories.
/lev: Copies only the top n levels of the source directory tree
/z Copies files in restartable mode. In restartable mode, should a file copy be interrupted, Robocopy can pick up where it left off rather than re-copying the entire file.
/b Copies files in backup mode. Backup mode allows Robocopy to override file and folder permission settings (ACLs). This allows you to copy files you might otherwise not have access to, assuming it’s being run under an account with sufficient privileges.
/zb Copies files in restartable mode. If file access is denied, switches to backup mode.
/j Copies using unbuffered I/O (recommended for large files).
/efsraw Copies all encrypted files in EFS RAW mode
/copy:<copyflags> Specifies which file properties to copy. The valid values for this option are:D – DataA – AttributesT – Time stampsS – NTFS access control list (ACL)O – Owner informationU – Auditing informationThe default value for this option is DAT (data, attributes, and time stamps).
/dcopy:<copyflags> Specifies which file properties to copy. The valid values for this option are:D – DataA – AttributesT – Time stampsS – NTFS access control list (ACL)O – Owner informationU – Auditing informationThe default value for this option is DAT (data, attributes, and time stamps)
/dcopy:<copyflags> Specifies what to copy in directories. The valid values for this option are:D – DataA – AttributesT – Time stampsThe default value for this option is DA (data and attributes).
/sec Copies files with security (equivalent to /copy:DATS).
/copyall Copies all file information (equivalent to /copy:DATSOU).
/nocopy Copies no file information (useful with /purge).
/secfix Fixes file security on all files, even skipped ones.
/timfix Fixes file times on all files, even skipped ones.
/purge Deletes destination files and directories that no longer exist in the source. Using this option with the /e option and a destination directory, allows the destination directory security settings to not be overwritten.
/mir Mirrors a directory tree (equivalent to /e plus /purge). Using this option with the /e option and a destination directory, overwrites the destination directory security settings.
/mov Moves files, and deletes them from the source after they are copied.
/move Moves files and directories, and deletes them from the source after they are copied.
/a+:[RASHCNET] Adds the specified attributes to copied files. The valid values for this option are:R – Read onlyA – ArchiveS – SystemH – HiddenC – CompressedN – Not content indexedE – EncryptedT – Temporary
/a-:[RASHCNET] Removes the specified attributes from copied files. The valid values for this option are:R – Read onlyA – ArchiveS – SystemH – HiddenC – CompressedN – Not content indexedE – EncryptedT – Temporary
/create Creates a directory tree and zero-length files only.
/fat Creates destination files by using 8.3 character-length FAT file names only.
/256 Turns off support for paths longer than 256 characters
/mon: <n> Monitors the source, and runs again when more than n changes are detected.
/mot:<m> Monitors the source, and runs again in m minutes, if changes are detected.
/MT[:n] Creates multi-threaded copies with n threads. n must be an integer between 1 and 128. The default value for n is 8. For better performance, redirect your output using /logoption.The /mt parameter can’t be used with the /ipg and /efsraw parameters.
/rh:hhmm-hhmm Specifies run times when new copies may be started.
/pf Checks run times on a per-file (not per-pass) basis.
/ipg:n Specifies the inter-packet gap to free bandwidth on slow lines.

Please Watching My Video is Below

No comments:

Post a Comment

Post Top Ad