Update lsyncd.sh
1 parent 543fbdb commit f6ade24ed91cddc4ef83c3bfebf597facc478ce0
Leonardus Kristaris Sastra authored on 22 Apr 2020
Showing 1 changed file
View
16
lsyncd.sh
 
yum install lsyncd -y;
 
echo "settings {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/tmp/lsyncd.stat",
logfile = $(echo '"/var/log/lsyncd/lsyncd.log"'),
statusFile = $(echo '"/tmp/lsyncd.stat"'),
statusInterval = 1,
}
sync {
default.rsync,
source = "/var/www/html/wp",
target = "backend2.floss.my.id:/var/www/html/wp",
source = $(echo '"/var/www/html/wp"'),
target = $(echo '"103.23.20.132:/var/www/html/wp"'),
}
sync {
default.rsync,
source = "/etc/nginx/conf.d/blocks.conf",
target = "backend2.floss.my.id:/etc/nginx/conf.d/",
source = $(echo '"/etc/nginx/conf.d/"'),
target = $(echo '"103.23.20.132:/etc/nginx/conf.d/"'),
}
rsync = {
update = true,
perms = true,
owner = true,
group = true," > /etc/lsyncd.conf;
group = true, }" > /etc/lsyncd.conf;
 
systemctl restart lsyncd;
systemctl status lsyncd;
 
ssh root@backend2.floss.my.id "nginx -t; nginx -s reload; systemctl status nginx;";
ssh root@103.23.20.132 "nginx -t; nginx -s reload; systemctl status nginx;";