"Hi, we have two shared folders. One is primary which is shared with the user and almost about to fill and the other is not shared yet but I want to sync all the data from primary to new one with Robocopy command line.
To sync changes from the primary folder to the new folder using Robocopy, you can use the following command:
Sometimes, you may need to sync two folders located in different computers or other locations, such as, internal or external drives, to make the two folders keep the same content. Here we will show you different ways to perform Windows sync two folders with command line tool.
Robocopy is a robust file copy command for Windows PCs and it allows you to copy files, directories, and even drives from one location to another. It provides you with different parameters to sync two folders in Windows 11/10/8/7.
👉 Robocopy command line syntax: To sync two folders, you can use the Robocopy command-line tool. Here are the steps:
robocopy [Source] [Destination] [(File)( ...)] [(Options)]
Source | It specifies path to source directory, type as, drive:\path or \\server\share\path. |
Destination | It specifies path to destination directory, type as, drive:\path or \\server\share\path. |
File | It specifies files you want to copy, type as, names/wildcards: default is "*.*". |
Options | It specifies copy, file, retrt, logging, and job options to use with robocopy command. |
👉 Common used options in Robocopy:
👉 To know more parameters you could use, please input robocopy /? to get more details.
Robocopy is a powerful tool for synchronizing files between two locations. Here are some common scenarios where you can use Robocopy:
To sync two folders on different computers through a shared folder, you can use the following command line:
robocopy \\192.168.0.250\PublicShare\temp \\192.168.0.58\WorkD /e /copy:DAT /mt /z
Notes:
To create an incremental sync task with Robocopy, you can use the `/xo` or `/xc` option. These options allow Robocopy to sync only the changes made to the source folder since the last sync, rather than re-copying all files.
To sync changed part from source `\\192.168.0.250\PublicShare\temp` to `\\192.168.0.58\WorkD` in restart mode and create multi-threaded copies with 8 threads, use the following command line:
robocopy \\192.168.0.250\PublicShare\temp \\192.168.0.58\WorkD /e /copy:DAT /mt /z /xc /xn /xo
Notes:
In addition to excluding files existing in the destination directory with `/xc`, `/xn`, and `/xo`, Robocopy also offers the `/mot` option to monitor changes in a specified time interval.
To monitor changes every one minute, you can use the following command:
robocopy \\192.168.0.250\PublicShare\temp \\192.168.0.58\WorkD /e /copy:DAT /mt /z /xc /xn /xo /mot:1
Note:
In addition to using the Robocopy command, you can also utilize batch files and the Windows Task Scheduler to continuously copy all file changes. This approach allows for a more manual and customizable solution to monitor file changes and synchronize them to a destination.
In addition to the Robocopy command, you can also utilize the /purge parameter to specify a mirror sync task. This will delete any files or directories in the destination that no longer exist in the source, effectively maintaining a mirror image of the source at the destination.
To perform a two-way sync, you will need to create a batch file using Notepad. For a detailed guide on how to do this, please refer to the article on Robocopy two-way sync.
Robocopy is a helpful tool for one-way file copying, but it has limitations when it comes to syncing two folders in a two-way sync.
Except for the Robocopy command line, you still can try GUI-based file synchronization software - Qiling Disk Master Professional. It supports Windows XP, Vista, 7, 8, 8.1,10 and 11(32-bit and 64-bit) and helps you sync two folders easily with the following options.
Besides, it still allows you to sync two folders to multiple destinations, such as local disk, external hard drive (HDD or SSD), CD/DVD, USB flash drive, network share or NAS, even to cloud drives like Google Drive, Dropbox, OneDrive, Box, etc.
To begin, download and install Qiling Disk Master Professional on a Windows PC. If you're a server user, you can try Qiling Disk Master Server instead.
Step 1. Launch Qiling Disk Master Professional on your Windows 10 computer. Navigate to the Backup and recovery tab and select a method to sync two folders.
Step 2. Press Folder or Share/NAS device.
Step 3. Click Add NAS Devices and input the display name and network path to add the network share. You will also need to specify the folders you want to sync. If you encounter an error while adding the network path, you will need to enter your username and password.
Step 4. Click Proceed to enable real-time folder synchronization in Windows. Alternatively, you can click Options to configure additional settings, such as commenting on the sync task, enabling email or SMS notifications, and verifying the integrity of files in the destination location during synchronization.
Following the initial full folder sync, any subsequent changes made to the source folder will be synced to the destination in real-time. This approach provides the highest level of file protection, but it also requires the most disk space compared to other synchronization methods.
If disk space is a concern, alternative sync methods can be employed. These include Mirror Sync, which can be scheduled to run at daily, weekly, or monthly intervals, or triggered by specific events, such as a USB device being plugged in. This approach can help mitigate the disk space issue to some extent.
To fully resolve the issue, consider utilizing the Backup feature to create duplicates of files. This not only schedules backup files but also automatically deletes old backup images, freeing up disk space. Three options are available:
In addition, you can also choose to backup folders to Qiling Cloud, a cloud drive that offers 1TB of free storage, and provides 15 days of free access after registration. This allows you to automate the backup task, running it on a schedule such as daily, weekly, or monthly.
In comparison to using the Robocopy command-line tool to sync two folders on Windows, Qiling Disk Master Professional offers more flexibility and convenience. This powerful file sync software allows you to choose from various sync methods and schedule settings, tailored to your specific needs, on Windows 11, 10, 8, and 7.
In addition to its file sync capabilities, Qiling Disk Master Professional is also a professional backup software. If you're concerned about disk space, the File Backup feature can help. This feature allows you to schedule backups, choose between incremental or differential backup methods, and automatically clean up backup files to efficiently manage your backup tasks and disk space.