Rsync 模块路径需要是主目录
我正在尝试使用 rsync 将 Windows 服务器备份到 rsync 服务器。 我在 Linux 端遇到 rsync 问题,它不喜欢符号链接。
目前我正在尝试使用 ~/backup
的模块路径,但 rsync 说 chroot 失败。 我查了一下要做什么,发现我需要添加选项 use chroot = no
和 munge symlinks = no
。 这修复了 @ERROR: chroot failed
但现在它告诉我 @ERROR: chdir failed
并且日志文件显示没有 ~/backup 目录。 我知道我正在验证的用户的目录中有一个备份文件夹。
我怎样才能解决这个问题?
作为参考,我使用名为 NetSync 的 rsync .NET 端口,并通过 granados 生成的端口转发 SSH 连接对其进行隧道传输。
I'm trying to use rsync to backup windows servers to an rsync server. I'm having problems with rsync on the linux side though, it doesn't like symlinks.
Currently I'm trying to use the module path of ~/backup
, but rsync says that the chroot failed. I looked up what to do and saw that I needed to add the option use chroot = no
and munge symlinks = no
. That fixed the @ERROR: chroot failed
but now it's telling me @ERROR: chdir failed
and the log files say that there is no ~/backup directory. I know the user I'm authenticating with has a backup folder in his directory.
How can I fix this?
For reference I'm using a .NET port of rsync called NetSync and tunneling it over a port forwarded SSH connection generated with granados.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
IIRC,波形符(~)扩展是由 shell 完成的。 chdir() 不处理这个问题。
尝试绝对路径。 如果您不喜欢这样,请尝试使用“backup”(或./backup),假设登录后当前目录将设置为用户的主目录。
IIRC, tilde (~) expansion is done by the shell. chdir() doesn't handle this.
Try an absolute path. If you don't like that, then try using "backup" (or ./backup) on the assumption that after login, the current directory will be set to the user's home directory.
据我了解,您的路径似乎应该是 /home,并且由您的用户移动到他自己的目录中。
还有另一种解决方案,涉及为每个用户声明一个模块,但这对于目的来说似乎过于复杂。
As far as i understand it, it seems that your path should be /home, and that it is up to your user to move into his own directory.
There is another solution that involves declaring a module for each user, but that seems overly complex for the purpose.
这有点太晚了,但是如果目录不存在,chroot 就会失败。 您检查 ~/backup 是否实际上已创建?
This is a bit too late, but chroot fails if the directory does not exist. Did you check if ~/backup has actually been created?