Differences

This shows you the differences between two versions of the page.

Link to this comparison view

how_to_take_robocopy_incremental_backup [2017/09/05 12:18] (current)
Line 1: Line 1:
 +====== How to take Robocopy Incremental Backup ======
  
 +Recently, I need to backup file to NAS Storage device or external Storage Drive. I'm trying to use Robocopy with an incremental backup mode each night during the week. I create a Robocopy batch file for demo. I hope it can help you.
 +
 +Create Your Robocopy Script to backup file with Incremental Backup Mode
 +
 +Open notepad, paste this string into the notepad and save it
 +<sxh bash>
 +@echo off
 +set source="​c:​\source"​
 +set dest="​c:​\dest"​
 +robocopy.exe %source% %dest% /S /COPYALL /NP /TEE /R:3 /W:3 /​Log:​c:​\Logs\logs.txt
 +</​sxh>​
 +
 +Copy Option and Description
 +
 + 
 +^Option^Description^
 +|/S |Copies subdirectories. Note that this option excludes empty directories.|
 +|/E |Copies subdirectories. Note that this option includes empty directories. |
 +|/COPYALL |Copies all file information include the data,​Attributes,​Time stamps,NTFS access control list (ACL),Owner information,​Auditing information.|
 +|/NP  |Specifies that the progress of the copying operation (the number of files or directories copied so far) will not be displayed.|
 +|/TEE |Writes the status output to the console window, as well as to the log file.|
 +|/R:  |Specifies the number of retries on failed copies. The default value of N is 1,000,000 (one million retries).|
 +|/W:  |Specifies the wait time between retries, in seconds. The default value of N is 30 (wait time 30 seconds).|
 +|/MIR  | Mirrors a directory tree (equivalent to /e plus /purge). For additional information ​ |
 +|/FFT |Assumes FAT file times (two-second precision). | 
 +|/Z |Copies files in Restart mode. | 
 +|/NDL| Specifies that directory names are not to be logged.| ​
 +|/SECFIX |Fixes file security on all files, even skipped ones. |
 +|/​SEC|Copies files with security (equivalent to /copy:DAT). |   
 +
 +Open notepad, paste this string into the notepad and save it
 +<sxh bash>
 +@echo off
 +set source="​c:​\source"​
 +set dest="​c:​\dest"​
 +robocopy.exe %source% %dest% ​ /MIR /COPYALL /Z /NP /NDL /SECFIX /SEC /TEE /R:3 /W:3 /​Log:​c:​\Logs\logs.txt
 +</​sxh>​
 +===== References =====
 +  - http://​www.sthshare.com/​wordpress/​how-to-take-robocopy-incremental-backup.html
 +  - https://​technet.microsoft.com/​en-us/​library/​cc733145.aspx
 +  - http://​social.technet.microsoft.com/​wiki/​contents/​articles/​1073.robocopy-and-a-few-examples.aspx