-
Notifications
You must be signed in to change notification settings - Fork 0
/
Robocopy CLI
59 lines (48 loc) · 2.22 KB
/
Robocopy CLI
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
List of variables:
/L - Test Mode
/E - Copy All Files and Folders
/mov - Move action
/MIR - Mirror Source to Destination
/s - copy Subdirectories, but not empty ones.
/E copy subdirectories, including Empty ones.
/j - copy using unbuffered I/O (recommended for large files).
/R:n - number of Retries on failed copies: default 1 million.
/W:n - set amount to wait betwen tries
/MAXAGE 7 - Minimum file age
/MINAGE 365 - Maximum file age
/MIN:"File Size" - Minimum file size
/MAX:"File Size" - Maximum file size
/XA:SH - Excluded hidden system files
/COPYALL - Copy all attributes
PURGE - Delete destination files/dirs that no longer exist in source.
/COPYALL - COPY ALL file info (equivalent to /COPY:DATSOU).
/NOCOPY - COPY NO file info (useful with /PURGE).
/copy:datxsou - Copy with Data,Attributes,Timestamps,x skip alternate data, security, owner u auditing info.
/dcopy:datex - Copy with Data,Attributes,Timestamps,EA and skip alternate data.
/rh:1900-0600 - Set the hours to perform an action.
/MT:32 - Change the multi-threading speed.
/log:"File Path and Filename" - Create a new log file.
/LOG+:"File Path and Filename" - Append Log to existing file.
/XD "File PAth" "File Path" - Exclude Directories.
/ZB - use restart able mode; if access denied use Backup mode.
/XJD - exclude junction points
/TEE - Display content in cmd window.
EXAMPLES:
Perform a Test Copy:
Robocopy "Source Path" "Destination Path" /L
Perform a copy:
Robocopy "Source Path" "Destination Path"
Perform a copy keeping all attributes i.e. permissions etc:
Robocopy "Source Path" "Destination Path" /E /COPYALL
Perform a Move action:
Robocopy "Source Path" "Destination Path" /move
Perform a Move keeping all attributes i.e. permissions etc:
Robocopy "Source Path" "Destination Path" /move /E /COPYALL
Mirror Files:
Robocopy "Source Path" "Destination Path" /mir
Robocopy "Source Path" "Destination Path" /MIR /R:0 /W:15 /MT:32 /V /NP /XA:SH /E /ZB /XD "Downloads" "AppData" /LOG:robocopy.log /TEE
Example Syntax:
Initial Data Transfer:
robocopy "Source" "Destination" /NP /MT:32 /E /R:3 /W:5 /ZB /COPYALL /LOG:C:\Logs\AuditLog.log
Subsequent Data Transfer:
robocopy "Source" "Destination" /NP /MT:32 /E /R:3 /W:5 /ZB /COPYALL /MIR /LOG+:C:\RobocopyLogs\AuditLogIncremental.log