As we mentioned earlier, one-way synchronization uses rsync + inotify-tools. In some special usage scenarios, two-way synchronization may be required, which requires inotify-tools + unison.
Ocaml is a programming language, and the bottom layer of unison depends on it.
[root@Rocky~]# wget -c https://github.com/ocaml/ocaml/archive/refs/tags/4.12.0.tar.gz[root@Rocky~]# tar -zvxf 4.12.0.tar.gz -C /usr/local/src/[root@Rocky~]# cd /usr/local/src/ocaml-4.12.0[root@Rocky/usr/local/src/ocaml-4.12.0]# ./configure --prefix=/usr/local/ocaml && make world opt && make install
...
[root@Rocky~]# ls /usr/local/ocaml/
binlibman
[root@Rocky~]# echo PATH=$PATH:/usr/local/ocaml/bin >> /etc/profile[root@Rocky~]# . /etc/profile
[root@Rocky~]# wget -c https://github.com/bcpierce00/unison/archive/refs/tags/v2.51.4.tar.gz[root@Rocky~]# tar -zvxf v2.51.4.tar.gz -C /usr/local/src/[root@Rocky~]# cd /usr/local/src/unison-2.51.4/[root@Rocky/usr/local/src/unison-2.51.4]# make UISTYLE=txt
...
[root@Rocky/usr/local/src/unison-2.51.4]# ls src/unison
src/unison
[root@Rocky/usr/local/src/unison-2.51.4]cp-psrc/unison/usr/local/bin
Our requirement is-Rocky Linux 8's /dir1/ directory is automatically synchronized to Fedora 34's /dir2/ directory; at the same time, Fedora 34's /dir2/ directory is automatically synchronized to Rocky Linux 8's /dir1/ directory