5分钟入门lsyncd

5分钟入门lsyncd

lsyncd 是基于lua封装的inotify + rsync

创新互联主要从事成都网站设计、做网站、成都外贸网站建设公司、网页设计、企业做网站、公司建网站等业务。立足成都服务洞头,10年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:13518219792

lsyncd install

yum install -y gcc gcc-c++ make camke lua lua-devel

git clone https://github.com/axkibe/lsyncd.git

cmake .
make
sudo make install

lsyncd config

settings {
    logfile = "/var/log/lsyncd.log",
    statusFile = "/var/log/lsyncd-status.log",
    statusInterval = 20
}

sync {
   default.rsyncssh,
   source="/srcdir",
   host="remotehost",
     exclude = { '*.bak' , '*.tmp' },
   excludeFrom="/etc/lsyncd.exclude",
   targetdir="/dstdir",
   rsync = {
     archive = true,
     compress = false,
     whole_file = false
   },
   ssh = {
     port = 1234
   }
}

lsyncd use


lsyncd -rsync /home/USER/src /home/USER/dst
lsyncd -rsync /home/USER/src remotehost:dst
lsyncd -rsync /home/USER/src remotehost1:dst -rsync /home/USER/src remotehost2:dst 
lsyncd -rsyncssh /home/USER/src REMOTEHOST TARGETDIR

lsyncd -nodaemon CONFIGFILE
lsyncd -log all CONFIGFILE

分享名称:5分钟入门lsyncd
URL标题:http://lszwz.com/article/ieddjo.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款