- #!/bin/bash
- yum install lsyncd -y;
- echo "settings {
- logfile = "/var/log/lsyncd/lsyncd.log",
- statusFile = "/tmp/lsyncd.stat",
- statusInterval = 1,
- }
- sync {
- default.rsync,
- source = "/var/www/html/wp",
- target = "backend2.floss.my.id:/var/www/html/wp",
- }
- sync {
- default.rsync,
- source = "/etc/nginx/conf.d/blocks.conf",
- target = "backend2.floss.my.id:/etc/nginx/conf.d/",
- }
- rsync = {
- update = true,
- perms = true,
- owner = true,
- group = true," > /etc/lsyncd.conf;
- systemctl restart lsyncd;
- systemctl status lsyncd;