CentOS Stream 9
Sponsored Link

Lsync : Synchronize Files / Directories2022/06/30

 
Install Lsync to configure live mirroring files and directories with Rsync + Lsync.
[1]
Configure rsyncd service on copy target Host, refer to here.
This example is based on the environment like follows as the link above, and additionally install lsyncd on copy source Host.
+----------------------+          |          +----------------------+
|    [dlp.srv.world]   |10.0.0.30 | 10.0.0.51|  [node01.srv.world]  |
|        lsyncd        +----------+----------+        rsyncd        |
|     /home/work/*     |   ------------->    |     /home/backup/*   |
+----------------------+      live copy      +----------------------+

[2] Install Lsync on copy source Host.
# install from EPEL

[root@dlp ~]#
dnf --enablerepo=epel -y install lsyncd
[root@dlp ~]#
vi /etc/lsyncd.conf
# line 8 : comment out
-- sync{default.rsyncssh, source="/var/www/html", host="localhost", targetdir="/tmp/htmlcopy/"}

# add to the end
settings{
    statusFile = "/var/run/lsyncd.stat",
    statusInterval = 1,
}

sync{
    default.rsync,
    # copy source directory
    source="/home/work/",
    # copy target Hostname or IP address : the name set in rsyncd.conf
    target="node01.srv.world::backup",
    # exclude file list
    excludeFrom="/etc/rsync_exclude.lst",
}

[root@dlp ~]#
systemctl enable --now lsyncd

[3]
That's OK.
Verify settings to create test files or directories on copy source Host and they are copied lively on copy target Host.
Matched Content