Robocopy: copy only missing files
Robocopy /XO /XN /XC options to copy only files missing from the destination, with a bacpac move example.
Using robocopy to copy only the files missing from the destination, plus an example of moving large files.
Copy only missing files
robocopy <sourcepath> <destinationpath> /E /XO /XN
/E: copies subdirectories, including empty ones./XO: excludes older files (present on both sides, source timestamp older or equal)./XN: excludes newer files (present on both sides, source timestamp newer).
The net effect is that only files that do not exist at the destination are copied.
Other exclusion options
| Option | Effect |
|---|---|
/XC |
exclude changed files |
/XN |
exclude newer files |
/XO |
exclude older files |
/XX |
exclude extra files and directories |
/XL |
exclude lonely files and directories |
Example: move bacpac files
robocopy.exe H:\ F:\ appdb*.bacpac /MOV /MT:32 /R:3 /W:5 /E /COPY:DAT /V /TEE /LOG:C:\robocopy_log.txt /J
/MOV: moves files (deleted from the source after copy)./MT:32: multithreaded copy (32 threads)./R:3 /W:5: 3 retries, 5 seconds between retries./COPY:DAT: copy data, attributes and timestamps./V: verbose output;/TEE: output to console and log./LOG:: log file./J: unbuffered I/O (suited to large files).