Skip to content

Instantly share code, notes, and snippets.

@nanoDBA
Created September 28, 2022 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nanoDBA/78d4753379bfe24804ea81d5244b4482 to your computer and use it in GitHub Desktop.
Save nanoDBA/78d4753379bfe24804ea81d5244b4482 to your computer and use it in GitHub Desktop.
robocopy root of a volume unbuffered and multithreaded with 128 threads
#robocopy root of a volume multithreaded unbuffered
$description = 'SRV_Migration'
$source = '\\10.0.0.0\P$'
$target = 'P:'
$robocopyLogFilename = "$($target)\" + ( [string](Get-Date -format "yyyy-MM-dd_HH-mm-ss") ) + "_" + $($description) + "_(" + ($target).Substring(0,1) + ")_robocopy.log"
# exclude the Recycle Bin and sysvol folders, and exclude pagefile
robocopy $source $target * /E /W:10 /XD "System Volume Information" "`$RECYCLE.BIN" /LOG+:$robocopyLogFilename /NP /TEE /SEC /MT:128 /XF pagefile.sys /J
<#
Q: source
L: destination
To get more of these below you can run in cmd or powershell robocopy /?
/TEE = spit out to console.
/XF pagefile.sys - this excludes files like pagefile.sys. use space in between files to ignore.
/SEC - copy over security
/XD - we do not want to copy these directories. (Exclude Directory) space seperated list.
/E - copy subdirectories including empty directories
/NP - No Progress (don't display percentage copy)
***Potential Danger - see below link on unbuffered I/O and consider omitting for network copies of large files
/J :: copy using unbuffered I/O
https://superuser.com/questions/1114311/are-there-any-pros-cons-to-the-j-robocopy-option-unbuffered-copying
#>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment