Forked from aromig/robocopy_exclude_existing_files.cmd
Last active
July 3, 2018 08:21
-
-
Save hamdyaea/ace82dade3dd95f6a7294105a3afd5f9 to your computer and use it in GitHub Desktop.
Robocopy - Exclude Existing Files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Developer : Hamdy Abou El Anein | |
robocopy c:\Sourcepath c:\Destpath /E /S /XC /XN /XO | |
:: /E makes Robocopy recursively copy subdirectories, including empty ones. | |
:: /XC excludes existing files with the same timestamp, but different file sizes. Robocopy normally overwrites those. | |
:: /XN excludes existing files newer than the copy in the source directory. Robocopy normally overwrites those. | |
:: /XO excludes existing files older than the copy in the source directory. Robocopy normally overwrites those. | |
:: With the Changed, Older, and Newer classes excluded, Robocopy will exclude files existing in the destination directory. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Work better without exclusion
:: Developer : Hamdy Abou El Anein
:: First run make a complete backup
:: Other runs create an incremental copy
:: Robocopy \192.168.1.9\prod E:\IncreBackup /XC /XN /XO /TEE /S /R:3 /W:3 /v /fp /log:C:\Users\13prod2095\Desktop\NAS_Backup\backup.log
Robocopy \192.168.1.9\prod E:\IncreBackup /TEE /S /R:3 /W:3 /v /fp /log:C:\Users\13prod2095\Desktop\NAS_Backup\backup.log