Sync Changes Only With Robocopy

How to Sync Changes Only With Robocopy

Want to sync files between devices? Then here is new tool to try. Robocopy sync is the new way to go for file sync function. Use Robocopy to sync folders. This article is your guide to know how to use Robocopy /xo for syncing files and folders.

Wondershare Recoverit Authors

Nov 23, 2020 • Filed to: Take Data Backup • Proven solutions

0

I'm using robocopy to copy files to a samba share. The drive contains around 800 GB of data with over a million files that are 20-80K each. The issue I'm having is that robocopy copies all files each time (which takes around 12 hours). I'd like it to only copy new or changed files each time. Below is the command line I'm using:

robocopy d:\ \\samba\share\ /e /z /r:0 /w:0 /copy:DAT /xd $RECYCLE.BIN /xd "System Volume Information"

I've used these options when copying to Windows shares and it's worked as I want but for whatever reason when copying to a samba share it copies all files. Any ideas on how to get robocopy to only copy new/changed files to a samba share? Also, anyone has a better solution than robocopy?

Synchronization or syncing files is an important task that should not be taken for granted. It is a way in which you can keep the updated version of your data and use it as restore points. In case of any disaster i.e. technical (system crash) or physical, you may lose your data. Using the synced copy of data, you can rehabilitate your device to the last working condition. Though there are several built-in tools and mechanisms for carrying out the sync function, yet there is a new tool in the market. Robocopy is there to sync your files. This article is all about the introduction of Robocopy /xo as a tool, Robocopy sync capabilities, and how to use Robocopy to sync folders.

As a tool, Robocopy (robust file copy) is a special command-based directory that works on commands to deal with syncing and copying functionalities for the windows operating system. It is a top-notch feature presented by windows with NT4.0. Robocopy became a standard utility of windows with the arrival of Vista. The command line used in the utility is different from the regular ones as it excels in mirroring and copying folders and directories of any size. Along with copying the folders, the Robocopy cmd mirror the essentials like timestamps, properties, and NTFS ACLS. For the network-based folders, Robocopy /xo comes up with a feature of resume copy. With this feature, it can tolerate the faulty network and resume the sync function from the point it left, as the name implies 'resume copy'. It also has the capacity of skipping the infinite loops that causes sync failures. It can copy between the ranges of 259-32,000 characters without any error. As mentioned above, this tool works on command lines, so here are some of the commands that are employed to copy the files/folders.

  1. /S - Copies subdirectories, excluding empty ones
  2. /LEV:n - Copies the higher "n" levels from the source
  3. /Z - Restartable mode
  4. /B - Backup mode
  5. /ZB - Restartable mode; otherwise backup mode
  6. /SEC - Copies with security
  7. /COPY ALL - Includes all file info while copying, including security info

This article would be discussing every detail linked to this Robocopy /xo and gives a thorough explanation regarding how to use Robocopy to sync folders. Here are the topics that would be discussed in detail.

Part 1: Advantages of Copying Only Changed or New Files with Robocopy

As mentioned above, Robocopy /xo is used to copy the files and folders on the network along with the complete directories, you can also employ the tool copying only new files i.e. Robocopy only new files. Using Robocopy for this purpose is quite common. Why? Let's have a look!

  1. Time-saving: Copying the changes does not take much time. So despite copying all files and folders time and again would take time, use the tool to copy or mirror the changes made on files and folders.
  2. Disk space-saving: Creating backup for files and folders again and again not only introduce errors rather it requires a huge space for storage. Copying the same files would occupy all the space on disk and leaves no room for the new one. So to avoid the overcrowding, copying the new changes with Robocopy is a smart move.

These two points are valid to save time and to avoid space linked issues. Hence, Robocopy /xo can be used for syncing/copying/mirroring the new files only i.e. Robocopy copy only new files.


Part 2: How to Copy Changes Only with Robocopy Command?

As mentioned above, Robocopy copy only new files technique is fascination g for all. It helps to sync files and folders quite easily without consuming time and disk space. So here are the steps to elaborate on how to copy changes only with the Robocopy command.

Step 1: In the main menu of windows, click Start, and in the search box, type CMD to run the command prompt.

Step 2: In the drop-down, select the option of command prompt and again in the drop-down click on run as administrator.

Step 3: As soon as the command prompt launches, type the desired Robocopy command lines to perform the targeted function. Here is the command:

robocopy / maxage:

Here "/maxage:" denotes the farthest modification time. The file with a huge time frame would not be copied i.e. as mentioned above, it can only copy the newly made changes to save time and space.

copy-changes-with-robocopy-command-1

Here are some of the commonly employed command parameters:

  1. /XC :- eXclude Changed files.
  2. /XN :-eXclude Newer files.
  3. /XO :-eXclude Older files.
  4. /IS :- Include the Same files.
  5. /E:-means copy all subdirectories including empty folders

Enter the desired command line or parameter in the command prompt and leave the rest to this amazing tool. It will copy/sync/mirror smartly.


Part 3: How to Copy Only New or Modified Files with AOMEI Backupper?

Sometimes, it is quite difficult for the users, mostly for the newbies to use the command lines. They can make mistakes and end up with no results. So here is an alternative for the, using a third party application software that can help at this time. AOMEI more backup professional is a top-notch backup software that carries outstanding data migration tools. It is compatible for your Windows 10/8/7, XP, and Vista. It helps to create systems and disk images that occupy less space. Here is how you can use the software to sync or copy files and folders.

Step 1: Download the software and then run an install as administrator.

Step 2: Once installed successfully, launch the software on your device, and in the main interface select the option of backup followed by selecting file backup.

select-file-backup

Step 3: In the file backup window, the next step is to click on the add folder to add the source drive/folder targeted for backup. Click ok to proceed.

file-backup-add-folders-files

Step 4: From the drop-down, select the destination drive (be it Cloud drive, shared folder, or NAS).

file-backup-select-destination

Step 5: In case you want to schedule the backup function, configure the schedule settings. Check the box of differential backup and click ok to continue.

Step 6: Once all steps are completed, click start backup to complete the action.

file-backup-start-backup

Your backup would be automatically saved on the destination location/drive. Scheduling your backup can be done on a daily, weekly, or monthly basis. Moreover, you would get an email notification regarding the completion or failure of the process.

Hence, as mentioned earlier, synchronization or syncing the files and folders saved on multiple locations is an important task. You have to carry out a regular sync function to keep your data updated on all locations. In this regard, Windows present you with a built-in sync tool i.e. Robocopy /xo. It is used by the users to copy/sync and mirror the files and folders efficiently. The top-notch tool helps to perform the sync function smartly, as it only syncs/copy the files and folders only for new changes. This can help to save time and disk space. The tool follows the command lined based technique for carrying out functionality. Enter the particular command line and you are done with the task in no time. But using command lines is not easy. So for the newbies, here is this third party help alert. You can use AOMEI backupper professional for creating file backups in a few steps.

Recoverit author

Amy Dennis

staff Editor

(Click to rate this post)

Generally rated4.5(105participated)

Home > Resources > Take Data Backup > How to Sync Changes Only With Robocopy