1. Introduction to sersync
1. sersync is developed based on inotify and is similar to inotify-tools.
2. sersync can record changes (including adding, deleting, and modifying) in the monitored directory to the name of a specific file or directory. When Rsync is used, only the changed file or directory will be synchronized.
Ii. What are the differences between rsync + inotify-tools and rsync + sersync?
1. Rsync + inotify-Tools
(1) inotify-tools can only record changes (including adding, deleting, and modifying) to the monitored directories ), no specific file or directory changes have been recorded;
(2): During rsync, you do not know which file or directory has changed. The entire directory is synchronized each time. When the data volume is large, the entire directory synchronization is very time-consuming (rsync needs to traverse the entire directory to find the comparison file), so the efficiency is very low.
2. Rsync + sersync
(1) sersync can record the name of a specific file or directory that has changed (including adding, deleting, and modifying) in the monitored directory;
(2): During rsync, only the file or directory that has changed will be synchronized (the data changed each time is relatively small compared to the data in the entire synchronization directory, rsync is fast when searching and comparing files. Therefore, it is highly efficient.
Summary: when the amount of data in the synchronized directory is small, it is recommended to use rsync + inotify-tools (http://90sec.blog.51cto.com/7404127/1543843); when the amount of data is large (several hundred GB or even 1 Tb), a lot of files, we recommend that you use rsync + sersync.
3. Basic operation configuration
This article from the "broken knife" blog, please be sure to keep this source http://90sec.blog.51cto.com/7404127/1545036
Sersync + rsync real-time data synchronization setup