What those keys of robocopy mean "/E", "/COPY:DAT", "/DCOPY:DAT", "/W:1", "/R:3"
- User
What those keys of robocopy mean "/E", "/COPY:DAT", "/DCOPY:DAT", "/W:1", "/R:3"
- Assistant
Robocopy, or Robust File Copy for Windows, is a powerful command-line directory and file replication command. The switches or parameters you mentioned influence how Robocopy behaves. Here's what each of these keys means:
-
/E: This switch tells Robocopy to copy all subdirectories, including empty ones, of the source directory into the destination.
-
/COPY:DAT: This switch specifies what file information is to be copied. In this case, it indicates that the Data (D), Attributes (A), and Timestamps (T) of the files should be copied. This is the default setting for Robocopy if no /COPY switch is specified.
-
/DCOPY:DAT: Similar to /COPY:DAT, this switch controls what is copied for directories. It specifies that the Data (D), Attributes (A), and Timestamps (T) of directories should be copied along with the directory structure.
-
/W:1: This switch sets the wait time between retries to 1 second. After a failed copy attempt, Robocopy will wait 1 second before retrying. The default wait time is 30 seconds.
-
- User
what robocopy with those switches does when source file already exists in the destinantion?
- Assistant
When using Robocopy with the specified switches—
/E,/COPY:DAT,/DCOPY:DAT,/W:1, and/R:3—and a source file already exists in the destination, Robocopy will compare the files based on the default criteria to determine if it needs to overwrite the existing file. Here’s how those switches interact with existing files:-
File Comparison for Overwriting: By default, Robocopy will overwrite files that are different in source and destination based on timestamps or if the file data differs. The switch ensures that data, attributes, and timestamps should match between the source and destination for the file to be deemed identical.
-