From 65c2416fe9dde536d5c3aa89a36779d8eb6b9d6d Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Thu, 21 Dec 2023 23:38:53 -0700 Subject: [PATCH] Update Scripts/Batch/Robocopy.md --- Scripts/Batch/Robocopy.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Scripts/Batch/Robocopy.md b/Scripts/Batch/Robocopy.md index 45d99dc..59c90c6 100644 --- a/Scripts/Batch/Robocopy.md +++ b/Scripts/Batch/Robocopy.md @@ -1,20 +1,20 @@ Robocopy is a useful tool that can be leveraged to copy files and folders from one location to another (e.g. Over the network to another server) without losing file and folder ACLs (permissions / ownership data). !!! warning "Run as Domain Admin" - When you run Robocopy, especially when transferring data across the network to another remote server, you need to be sure to run the command prompt under the session of a domain admin. Secondly, it needs to be "Ran-as-Administrator" to ensure the command is successful. This can be done by going to the start menu and typing "Command Prompt" > Right Clicking > "Run as Administrator" while logged in as a domain administrator. + When you run Robocopy, especially when transferring data across the network to another remote server, you need to be sure to run the command prompt under the session of a domain admin. Secondly, it needs to be ran as an administrator to ensure the command is successful. This can be done by going to the start menu and typing "**Command Prompt**" > **Right Clicking** > "**Run as Administrator**" while logged in as a domain administrator. An example of using Robocopy is below, with a full breakdown: ``` robocopy "E:\Source" "Z:\Destination" /Z /B /R:5 /W:5 /MT:4 /COPYALL /E ``` -- `robocopy "Source" "Destination"` : The application itself -- `/Z` : If the network transfer is interrupted, it will resume when the network comes back online -- `/B` : Backup Mode - This can be used to circumvent ACLs on folders and files, just forcing them to copy bypassing permissions -- `R:5` : Number of times to retry copying the same file -- `W:5` : The number of seconds to wait between retries -- `/MT:4` : *_Threaded_* copies that run on their own threads -- `/COPYALL` : Retain all file/folder permissions and ownership data -- `/E` : Copy every folder, including empty ones ++ `robocopy "Source" "Destination"`: The application itself ++ `/Z` : If the network transfer is interrupted, it will resume when the network comes back online ++ `/B` : Backup Mode - This can be used to circumvent ACLs on folders and files, just forcing them to copy bypassing permissions ++ `R:5` : Number of times to retry copying the same file ++ `W:5` : The number of seconds to wait between retries ++ `/MT:4` : *_Threaded_* copies that run on their own threads ++ `/COPYALL` : Retain all file/folder permissions and ownership data ++ `/E` : Copy every folder, including empty ones !!! tip "Usage of Administrative Shares" Whenever dealing with copying data from one server to another, try to leverage "Administrative Shares", sometimes referred to as "Default Shares". These exist in such a way that, if the server exists in a Windows-based domain, you can type something like `\\SERVER\C$` or `\\SERVER\E$` to access files and bypass most file access restrictions (Generally for reading data, writing works too, but not in all circumstances).