Abstract: data is the most valuable property! The company's servers all need to have a complete backup policy for data. using scripts, scheduled tasks, open-source software, and so on, no matter which way, real-time data synchronization is the best effect! The following describes how to use rsync and inotify to trigger real-time data synchronization. Rsync: images can be used to save the entire directory tree and file system. It is easy to maintain the permissions, time, and soft links of the original file. During the first synchronization, rsync copies all the content, but transmits only modified files in the next synchronization.
Summary: Data is the most valuable property! The company's servers all need to have a complete backup policy for data. using scripts, scheduled tasks, open-source software, and so on, no matter which way, real-time data synchronization is the best effect! The following describes how to use rsync and inotify to trigger real-time data synchronization.
Rsync: Images can be used to save the entire directory tree and file system. It is easy to maintain the permissions, time, and soft links of the original file. During the first synchronization, rsync copies all the content, but transfers only modified files in the next synchronization.
Solution: At first, using rsync for data backup is to use a scheduled task and regularly execute the command to implement rsync synchronization. However, recently, the development team has made frequent changes. it seems that real-time backup needs to be synchronized to improve the backup mechanism! So we need to use the inotify trigger to improve it! It is synchronized once a new change is made to the specified location!
Environment:
CentOS 6.4 64-bit
Rsync-3.0.9
Inotify-tools-3.14