lsyncd


Setp 1 - Install

Install

  • 1) New VM
  • [New VM] RockyLinux85 => Copy vm
    [Network] eth0, VLAN_71, VLAN_81
    [Memory] 2G


  • 2) Lsyncd Install
  • eth0 - dhcp
    eth1 - ip : 192.168.71.9
    eth2 - ip : 192.168.81.9


    [Lsyncd]
    dnf install epel-release
    dnf install lsyncd -y
    /etc/lsyncd.conf
    ====================

    settings {
    	logfile="/var/log/lsyncd/lsyncd.log",
    	statusFile="/var/log/lsyncd/lsyncd-status.log",
    	insist=true,
    	statusInterval = 3
    }
    sync{
    	default.rsync,
    	source="/home/homepage",
    	target="192.168.71.21::homepage",
    	rsync = {
    		archive=true,
    		compress=true,
    		verbose=true
    	},
    	delay = 1,
    	exclude= { "*.bak", "*.tmp", "*.swp", ".svn*"}
    }
    sync{
    	default.rsyncssh,
    	source="/home/homepage",
    	host="192.168.71.22",
    	targetdir="/home/homepage",
    	rsync = {
    		perms = true,
    		owner = true,
    		archive=true,
    		compress=true,
    		verbose=false,
    		whole_file = false
    	},
    	ssh = { port = 22 },
    	delay =1,
    	exclude= { "*.bak", "*.tmp", "*.swp", ".svn*"}
    }
    		

    ====================

    [default.rsync]
    Client Server
    dnf install rsync* -y
    vi /etc/rsyncd.conf
    ====================

    # /etc/rsyncd: configuration file for rsync daemon mode
    # See rsyncd.conf man page for more options.
    # configuration example:
    uid = homepage
    gid = homepage
    use chroot = yes
    max connections = 10
    pid file = /var/run/rsyncd.pid
    log file = /var/log/rsyncd.log
    exclude = lost+found/
    transfer logging = yes
    # timeout = 900
    reverse lookup = no
    ignore nonreadable = yes
    dont compress   = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2
    
    [homepage]
    path=/home/homepage
    read only = false
    

    ====================

    systemctl start rsyncd
    systemctl enable rsyncd