标签:from file res lock lse css getdir srcdir remote
5分钟入门lsyncdlsyncd 是基于lua封装的inotify + rsync
yum install -y gcc gcc-c++ make camke lua lua-devel
git clone https://github.com/axkibe/lsyncd.git
cmake .
make
sudo make install
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 -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
标签:from file res lock lse css getdir srcdir remote
原文地址:https://blog.51cto.com/justinit/2471438