rh:hhmm-hhmm Specifies run times when new copies may be started. mot: Monitors the source, and runs again in m minutes, if changes are detected. mon: Monitors the source, and runs again when more than n changes are detected. move Moves files and directories, and deletes them from the source after they are copied. mov Moves files, and deletes them from the source after they are copied. mir Mirrors a directory tree (equivalent to /e plus /purge). purge Deletes destination files and directories that no longer exist in the source. e Copies subdirectories and includes empty directories. s Copies subdirectories and excludes empty directories. Click here to view the full edition of Robocopy syntax. If you have further needs, there are some common switches you could use to optimize your Robocopy incremental backup script. More copy options to optimize your Robocopy incremental backup script Then you can find the scheduled task in Task Scheduler Library and execute or delete it anytime you like. bat file) you just created.Ĭonfirm the information and click Finish to complete the process. Then click Browse to select the Robocopy backup script (the. Here I choose Daily and specify the time point in the next page.Ĭhoose Start a program as the action to perform the task. Open it, choose to Create Basic Task.Įnter the task name and description, then choose when or what to trigger the task. Search for Task Scheduler in Windows or in Control Pane. Then give it a name you like, Robocopy incremental backup, for example. Here I want to incremental copy all the subdirectories, so add the parameter /s as well.Ĭlick File > Save As. Open notepad, input the Robocopy backup script you want to implement. You can also create an incremental batch file with Robocopy, and then use Task Scheduler to automate it. *If you want to terminate the task, you could open another CMD window and enter “taskkill /f /im robocopy.exe”. This way, you can use Robocopy to incremental copy files at the frequency you set. In my case, I use the command below to back up changed files every 10 minutes. RH:hhmm-hhmm makes Robocopy to copy files between "hhmm" and "hhmm", e.g. MOT:m will execute another incremental backup if changes are detected in "m" minutes'. MON:n will monitor the source directory and execute incremental backup when "n" or more changes are detected. To create an incremental backup task using Robocopy on regular basis, you can either add parameters or use Windows Task Scheduler. Automate the incremental copy with Robocopy Robocopy C:\test D:\test /s /xo /z /np Step 4. You could combine Robocopy incremental backup with switches you need. *You can use other parameters, like /s (include subdirectories), /z (copy files in restartable mode), /np (don't display percentage of copied files) and so on. For example, if you first modify a file in folder A, and then the same file in folder B, the default incremental backup will copy A to overwrite B, while the /xo mode will skip the change because the file in folder B is newer. During copying the source directory, it will skip the files that already have the same or newer copies in destination directory. *You could also use /xo to exclude older files. It also backs up all the subdirectories even empty folders. *If you want to copy all the changes & deletions in the source directory as well, add /mir after the command. You could enrich your Robocopy incremental backup script with practical switches. Add useful switches to customize the backup If you add or modify files in source directory later and run Robocopy again, the changed and newly added files will be synchronized to the destination. The files in source folder will be copied to the destination folder.Ĭheck the target directory, you’ll find the files have been backed up successfully. The basic command of robocopy is: robocopy Press the Win+R key to open the “Run” window. To explain it clearly, I’ll give an example to backup files from C:\test to D:\test. You can use Robocopy to perform incremental copy automatically. How to Create Robocopy Incremental Backup Otherwise you could also use an incremental backup tool with recovery options to avoid this situation. If you don’t mind about it, keep reading and follow the steps to do incremental backup with Robocopy. That is to say, if you accidentally delete or modify something and run the backup unknowingly, these mistakes will be synchronized to the target directory, and you cannot retrieve any of the older copies.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |