Rsync can help you copy files between systems, mirror data, and do incremental backups. Learn how to use Rsync to sync multiple folders easily on this page.
I'm trying to sync three folders and all their contents from a remote server to a local folder using Rsync. How can I achieve that? What options should I use for Rsync multiple folders? Do you guys have any ideas?
Rsync (Remote Sync) is a powerful command-line tool that can help you copy and synchronize files between two locations, either on the same system or over a network. For example, you can use it to sync two hard drives, copy files between two servers, perform data backups, and mirror between two Linux machines.
There is no doubt that Rsync is a powerful sync tool with a variety of use cases. Some key advantages of this utility include:
The basic syntax of Rsync is # rsync [options] source destination. To make sure that you can use Rsync to sync two folders or multiple folders/files clearly, there is a list of some frequently-used Rsync options:
✅ source: Define the origin of the files or directories to be transferred, which may be either a local or remote location. ✅ destination: Indicate where the files or directories will be copied to, which can be either a local or remote path, similar to the source. ✅ -a: Enable archive mode, which supports recursive copying while preserving symbolic links, file permissions, ownerships, and timestamps. ✅ -v: Provide verbose output, showing comprehensive details about the transfer. ✅ -z: Compress data during the transfer, reducing bandwidth consumption. ✅ -h: Produce output in a format that is easier to read by humans. ✅ -p: Display the progress of the transfer. ✅ -r: Recursively copy data but do not maintain timestamps or permissions during the transfer.
To Rsync multiple files or multiple folders via command line or utilize Rsync to sync with a remote system, you need to ensure SSH access is configured between your local and remote machines, as well as Rsync installed on both systems. Then, try the following methods:
You can specify Rsync multiple directoriesin the command directly, appending each folder to the command, followed by the destination. This method is straightforward but can be cumbersome with a large number of folders:
>> rsync -av /path/to/source1/ /path/to/source2/ /path/to/destination/
This command synchronizes both /path/to/source1/ and /path/to/source2/ to /path/to/destination/.
A more scalable approach involves creating a directory that contains symbolic links (symlinks) to all the directories you want to sync. This setup minimizes the complexity of the Rsync command itself and is ideal for scenarios where the list of directories changes over time:
>> rsync -aL ~/tobackup/ /path/to/destination/
This method requires maintaining the symlink directory, but it simplifies the Rsync command and makes it easy to update the list of folders being synced.
AOMEI Backupper Standard is a professional yet free file sync software, supported on Windows 11, 10, 8.1, 8, 7, Vista, and XP, both for 32 bit and 64 bit. It comes with a user-friendly interface and offers various sync functions:
To sync multiple folders from one hard drive to another or from one computer to another using AOMEI Backupper, you can follow the steps below:
Step 1. Install and run CBackup on your computer.
Step 2. Select Sync from the left side, and click on Basic Sync.
Step 3. Tap on Add Folder to choose the folders you wish to synchronize. Then, select your sync destination path.
Step 4. You could click Schedule Sync to set up automatic sync if needed. Then, hit Start Sync to sync multiple folders with ease.
On this page, we have covered how to use Rsync to sync multiple folders. However, it should be noted that this method may be difficult for those who are not too familiar with the command line, and is prone to failing folder synchronization due to incorrect options. Therefore, a simpler approach is to turn to an easy-to-use file synchronization tool like AOMEI Backupper.
It offers one way sync, two way sync, and other sync features; also, you can use it to backup and restore files to/from various locations, and clone hard drive to SSD or other drives quickly and easily.