The Sync feature keeps two folders in different locations synchronized. Changes made in one folder are reflected in the other, making copies ideal for backups, restore points, and more. Windows offers the Robocopy command to manage file sync on your PC. In this article, we'll follow the tools tutorial on how to use Robocopy to sync only changes. We'll also learn how to automate the process with specialized tools.

Can Robocopy copy only changed or new files?

Robocopy is a powerful command-line directory replication tool used for copying files, folders, and directories, even from one hard drive to another. Apart from copying, you can also use the tool for synchronization. The utility is very accurate and fast when mirroring files and folders of any size.

Robocopy command

Robocopy has various commands to suit different purposes. Robocopy /xo is a command that only copies changed files. After executing this command, only modified files will be copied to the destination folder. This is helpful when you're disconnected or need incremental and differential backups. Here are some common Robocopy commands:

    • /s: Copies subdirectories, but not empty ones.
    • /e: Copies subdirectories, including empty ones.
    • /lev: Copies the first N levels of the source directory tree.
    • /z: Copies files in restartable mode.
    • /b: Copies files in backup mode.
    • /zb: Initially copies in restartable mode, switching to file backup mode if access is denied.
    • /efsraw: Copies all encrypted files in EFS raw mode.
    • /copyall: Copies all file information: D (Data), T (Timestamps), A (Attributes), S (Security: NTFS Access Control Lists (ACLs)), U (Audit information), and O (Owner information).

To know more about it, please open Command Prompt and type robocopy /? to view the details of this command.

If you found this article useful, please share it on your Facebook or other social media platforms to help more people learn about it!

No.

Use Robocopy to Copy Changed Files and Folders

Robocopy is used for one-way file synchronization; you can only sync from one location to another with the correct command. To synchronize only newly created or modified folders (an incremental sync), Robocopy has a special command. Using the /xo or /xc option tells Robocopy to sync changes only to the destination. Here's how:

Step 1. Click the Start button and search for Command Prompt.

Step 2. Run CMD as an Administrator.

Run Command Prompt as Administrator

Step 3. Type either of the following commands, and then press Enter. Both commands have the same effect.

    These two commands use Robocopy (Robust File Copy), a tool in Windows for copying files or folders. Here's an explanation of each: 1. `robocopy C:\sourceFolder1 E:\DestinationFolder2 /maxage:D`: - `robocopy`: This is the name of the command-line tool. - `C:\sourceFolder1`: The path of the source folder, from which you're copying from the C drive's sourceFolder1 directory. - `E:\DestinationFolder2`: The path of the destination folder, where you're copying to the E drive's DestinationFolder2 directory. - `/maxage:D`: This option means it will copy only files that have been modified within D days, where D should be replaced with a specific number of days. 2. `robocopy C:\sourceFolder1 E:\DestinationFolder2 /xo /maxage:D`: - This command adds the `/xo` option to the first one: - `/xo`: Executes "across directories" copy (eXecute option). If a subfolder in the source folder doesn't exist in the destination folder, it will create the subfolder before copying files. - The rest of the command remains the same as the first one. Adjust the path and the number of days (D) according to your actual needs.

robocopy only sync changes

You must specify the source and destination folders, and include the /xo switch to copy only changed files and folders.

/maxage:N specifies the “maximum file age” — files older than N days are excluded. Replace N with a number of days.

There are some commands similar to xo and xc for various purposes:

    - /xo: Exclude older files (excludes any existing files in the source that are older than the corresponding destination files). - /xc: Exclude changed files (excludes any existing files in the source that have the same timestamp as the destination files). - /xn: Exclude newer files (excludes any files in the source that are newer than the existing destination files). - /mt: Enable multi-threaded copy, with a default of 8 threads; you can specify a manual value if needed. - When used together, /xc, /xn, /xo: cause Robocopy to exclude all existing files in the destination directory.

Try to copy only new or modified files with Todo Backup

Command lines can be complicated and difficult to manage and execute for most computer users. A simple mistake can mess up the entire process. You need extensive knowledge to execute commands. If you lack command-line knowledge or want a user-friendly way to perform an incremental backup (which only syncs changed files), then Todo Backup might be a real solution for you.

tools Todo Backup Free is a comprehensive backup and recovery solution that offers unique incremental backup features, updating only altered or newly added files. You can also set it to run automatically at specified intervals, eliminating the need for manual operations. Additionally, you can automatically back up files, folders, hard drives, or your entire system and store them in the cloud. Once your backups are configured, a simple click on Start will save space and time during synchronization.

As one of the best file sync software for Windows 10, this free backup program offers all the features you want. Download the software now and start backing up.

Step 1: To start the backup process, click on the Select what to backup button.

Create File Backup Step 1

Step 2: Identify the four types of data backups: files, disks, operating system, and mail.

Create File Backup Step 2

Step 3: A list of both local and network files appears on the left side of the screen. Expand the folders and select the files you want to back up.

File Backup

Step 4. Follow the on-screen instructions to choose where you want to save your backup.

Step 4 of File Backup

Make sure backups are encrypted, and set up a backup schedule by clicking “Options” and adjusting the settings under “Backup Options.” You can also choose to start a backup at a specific time by clicking “Options” and setting a schedule under “Backup Plan. There are many other customizable options to explore as well.

Backup Options

Step 5. You can store the backup file on your computer, in a ToolBox cloud service, or on a network-attached storage (NAS) device.

Step 4: Create Backup

Step 6: Todo Backup allows users to store backup files on third-party cloud drives or the company's own cloud storage.

If you want to back up to a third-party cloud drive, select “Local Disk,” then scroll down and add a “Cloud Device.” Enter your account information when prompted.

Click Todo Backup > Cloud. If you want to store the backup file in Todo Backup's own cloud storage service, sign up and log in with a Todo Backup account.

Backup to Todoist Cloud

Step 7. Click Backup Now to start the backup process. When it's done, it will appear as a card on the left side of the screen. Right-click for more options on how to handle the backup job in more depth.

File Backup Step 7

Summarize in English (UTF-8 encoding):

The `/xo` command should only be used in conjunction with Robocopy sync changes only. However, the GUI version is much better for syncing changes only than complex and error-prone command-line utilities. Tools like Todo Backup let users easily sync two files, folders, or hard drives in Windows 11, 10, 8, and 7.

Todo Backup is also a comprehensive backup and recovery tool, making it ideal backup software. You can perform incremental and differential backups and store them in the cloud to save space on your computer. Download it now and sync the contents of two folders automatically.

Frequently Asked Questions About Robocopy Copying Only Changed Files or Folders

Here are some common questions about using Robocopy to sync only changes while preserving HTML tags in American English: 1. **How do I use Robocopy to sync only modified HTML files?** - You can use the `/MIR` (Mirror) option in Robocopy to sync changes, deletions, and additions, keeping the HTML file structure intact. The command would look like this: ``` robocopy source_directory destination_directory /MIR /XF *.html ``` This command mirrors the source directory to the destination, not overwriting HTML files unless they've been updated. 2. **How do I copy files without changing HTML tags?** - By default, Robocopy preserves file contents, including HTML tags. As long as you use the correct syntax, your HTML tags should stay the same during synchronization. 3. **How do I handle HTML files with only timestamp changes but no content changes?** - Robocopy usually considers any file with a different timestamp as modified. To avoid syncing files with only timestamp updates and no content changes, use the `/DCOPY:T` option to copy timestamps without treating them as modifications: ``` robocopy source_directory destination_directory /MIR /DCOPY:T /XF *.html ``` 4. **How do I exclude specific HTML files or directories?** - Use the `/XD` (Exclude Directories) or `/XF` (Exclude Files) options to exclude certain directories or files from the sync process. For example: ``` robocopy source_directory destination_directory /MIR /XD folder_to_exclude /XF file_to_exclude.html ``` 5. **How do I preserve permissions and attributes during the sync?** - Employ the `/COPY:DATSO` option to copy file data, attributes, timestamps, and ownership information: ``` robocopy source_directory destination_directory /MIR /COPY:DATSO /XF *.html ``` Make sure to replace `source_directory`, `destination_directory`, `folder_to_exclude`, and `file_to_exclude.html` with your actual paths and filenames.

Here are some frequently asked questions about Robocopy syncing changes only.

How do I use Robocopy to only copy changed or new files?

The Robocopy command to copy only changed or new files is by using the /xo and /maxage options. The /xo excludes older files from the source directory, while /maxage copies only the new files to the destination.

What are the advantages of using Robocopy over regular copying and pasting?

It has several advantages: When errors occur, Robocopy will attempt to copy files again, whereas a regular copy-paste operation will not. Also, Robocopy is much faster than a regular copy-paste.

3. What command can be used to copy only new files?

Robocopy has a /maxage command that copies only new file changes to the destination folder. /maxage is the maximum age, so it can copy just the changes made since a certain modification time, saving time and space.