【发布时间】:2016-07-27 05:40:00
【问题描述】:
我使用 lsyncd 将本地文件夹同步到我拥有的服务器,使用 rsyncssh 和这样的配置文件:
settings = {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/var/log/lsyncd/lsyncd.status"
}
sync {
default.rsyncssh,
source = "/Users/user/source",
host = "root@xxx.xxx.xxx.xxx",
targetdir = "/tmp/data",
rsync = { binary = "/usr/local/bin/rsync" }
}
现在,我想执行“拉取”以将另一台机器(不同网络)上的本地目录与该远程服务器同步。
我正在使用这个配置文件:
settings = {...}
sync {
default.rsync,
source = "root@xxx.xxx.xxx.xxx:/tmp/data",
target = "/home/user/dest",
rsync = { binary = "/usr/local/bin/rsync", _extra = { "-P", "-e", "ssh" } }
}
但我收到了这个错误:
Error: failure getting absolute path of [root@xxx.xxx.xxx.xxx:/tmp/data]
Error: Cannot access source directory: root@xxx.xxx.xxx.xxx:/tmp/data
当然 /tmp/data 存在,任何提示我做错了什么?
您知道是否可以将 lsyncd 与 rsync 一起使用,就像我使用它来使本地文件夹与远程源保持“最新”一样?或者我可以将 rsyncssh 与远程源一起使用吗?
谢谢!
【问题讨论】: