Update Scripts/Batch/Robocopy.md

This commit is contained in:
Nicole Rappe
2023-12-21 23:42:58 -07:00
parent 2757354281
commit 9d2da1a358

View File

@ -8,14 +8,14 @@ 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 "E:\Source" "Z:\Destination" /Z /B /R:5 /W:5 /MT:4 /COPYALL /E
``` ```
- `robocopy "Source" "Destination"` : The application itself - `robocopy "Source" "Destination"` : Initiates the Robocopy command to copy files from the specified source directory to the designated destination directory.
- `/Z` : If the network transfer is interrupted, it will resume when the network comes back online - `/Z` : Enables Robocopy's restartable mode, which allows it to resume file transfer from the point of interruption once the network connection is re-established.
- `/B` : Backup Mode - This can be used to circumvent ACLs on folders and files, just forcing them to copy bypassing permissions - `/B` : Activates Backup Mode, enabling Robocopy to override Access Control Lists (ACLs) and copy files regardless of the existing file or folder permissions.
- `R:5` : Number of times to retry copying the same file - `R:5` : Sets the maximum retry count to 5, meaning Robocopy will attempt to copy a file up to five times if the initial attempt fails.
- `W:5` : The number of seconds to wait between retries - `W:5` : Configures a wait time of 5 seconds between retry attempts, providing a brief pause before trying to copy a file again.
- `/MT:4` : *_Threaded_* copies that run on their own threads - `/MT:4` : Employs multi-threading with 4 threads, allowing Robocopy to process multiple files simultaneously, each in its own thread.
- `/COPYALL` : Retain all file/folder permissions and ownership data - `/COPYALL` : Instructs Robocopy to preserve all file and folder attributes, including security permissions, timestamps, and ownership information during the copy process.
- `/E` : Copy every folder, including empty ones - `/E` : Directs Robocopy to include all subdirectories in the copy operation, ensuring even empty directories are replicated in the destination.
!!! tip "Usage of Administrative Shares" !!! 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). 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).