5分钟入门lsyncd
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了5分钟入门lsyncd相关的知识,希望对你有一定的参考价值。
5分钟入门lsyncdlsyncd 是基于lua封装的inotify + rsync
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的主要内容,如果未能解决你的问题,请参考以下文章
Ubuntu16.04安装lsyncd并测试自动同步文件夹至备份服务器