22 lines
748 B
Plaintext
22 lines
748 B
Plaintext
# Basic copy
|
|
robocopy \\SERVER01\C$\Logs C:\LocalLogs
|
|
|
|
# Mirror a folder (exact copy, deletes extras at destination)
|
|
robocopy \\SERVER01\C$\WebApp C:\Backup\WebApp /MIR
|
|
|
|
# Copy with logging
|
|
robocopy \\SERVER01\C$\Data C:\Backup\Data /E /LOG:C:\Logs\robocopy.log
|
|
|
|
# Copy only changed files, retry on failure
|
|
robocopy \\SERVER01\C$\Data C:\Backup /E /Z /R:3 /W:5
|
|
|
|
# Useful flags
|
|
# /E = include subdirectories (including empty)
|
|
# /MIR = mirror (sync + delete)
|
|
# /Z = restartable mode (resume interrupted transfers)
|
|
# /R:3 = retry 3 times on failure
|
|
# /W:5 = wait 5 seconds between retries
|
|
# /LOG = write output to log file
|
|
# /NP = no progress (cleaner log output)
|
|
# /XF = exclude files, e.g. /XF *.tmp *.log
|
|
# /XD = exclude directories |