5分钟入门lsyncd-成都快上网建站

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
转载来于:http://kswjz.com/article/ieddjo.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流