rdiff-backup 无法工作,但 rsync 可以工作,Mandriva 适用于这两种操作系统

rdiff-backup 无法工作,但 rsync 可以工作,Mandriva 适用于这两种操作系统

我有两台服务器,都是 Mandriva 2010.2,有完全相同版本的 rdiff-backup(1.3.3)和完全相同的 rsync。我以前在 debian 中经常使用 rdiff-backup,但从那时起我就换了另一个操作系统。现在当我尝试使用 rdiff-backup 时,我只会收到大量错误。但通过 rsync 连接工作正常。

如下所示:

[root@localhost var]# rsync --rsh='ssh -p24752' -avz -e [电子邮件保护]:/var/test /var/backup 发送增量文件列表 drwxr-xr-x 4096 2012/06/22 13:27:38 备份

发送 39 字节 接收 13 字节 104.00 字节/秒 总大小为 0 加速为 0.00

但当我尝试通过 rdiff-backup 运行它时,发生了以下情况

[root@localhost var]# rdiff-backup --remote-schema 'ssh -C %s -p 24752' -v9 --print-statistics [email protected]::/var/test /var/backup
Fri Jun 22 13:45:20 2012  Using rdiff-backup version 1.3.3
Fri Jun 22 13:45:20 2012  Executing ssh -C [email protected] -p 24752
/usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py:148: DeprecationWarning: os.popen2 is deprecated.  Use the subprocess module.
  stdin, stdout = os.popen2(remote_cmd)
Fri Jun 22 13:45:20 2012  Client sending (0): ConnectionRequest: Globals.get with 1 arguments
Fri Jun 22 13:45:20 2012  Client sending (0): 'version'
Pseudo-terminal will not be allocated because stdin is not a terminal.
stdin: is not a tty
-bash: line 1: syntax error near unexpected token `crdiff_backup.connection'
-bash: line 1: `oh(crdiff_backup.connection'
Fri Jun 22 13:45:20 2012  Fatal Error: Truncated header string (problem probably originated remotely)

Couldn't start up the remote connection by executing

    ssh -C [email protected] -p 24752

Remember that, under the default settings, rdiff-backup must be
installed in the PATH on the remote system.  See the man page for more
information on this.  This message may also be displayed if the remote
version of rdiff-backup is quite different from the local version (1.3.3).

当我使用以下命令字符串复制并粘贴连接失败时,它立即正常工作(密钥对已设置)

[root@localhost var]# ssh -C[电子邮件保护]-p24752

上次登录时间:2012 年 6 月 22 日星期五 13:39:37,登录地址为 203-217-31-220.perm.iinet.net.au

两个服务器都是 root,两组文件都存在。我尝试使用 '-t -t' 的 ssh 命令来解决该 stdin 错误,但这会导致 python 内存异常 :/。

关于如何进行有什么想法吗?

编辑:此外,当我不使用自定义架构时,它也会这样做(或多或少相同,但端口 22 拒绝连接,因为我们不使用它:P

[root@localhost rdiffinstall]# rdiff-backup  -v9 --print-statistics [email protected]::/var/test /var/backup
Fri Jun 22 14:24:06 2012  Using rdiff-backup version 1.2.8
Fri Jun 22 14:24:06 2012  Executing ssh -C [email protected] rdiff-backup --server
/usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py:148: DeprecationWarning: os.popen2 is deprecated.  Use the subprocess module.
  stdin, stdout = os.popen2(remote_cmd)
Fri Jun 22 14:24:06 2012  Client sending (0): ConnectionRequest: Globals.get with 1 arguments
Fri Jun 22 14:24:06 2012  Client sending (0): 'version'
ssh: connect to host example.com.au port 22: Connection refused
Fri Jun 22 14:24:06 2012  Fatal Error: Truncated header string (problem probably originated remotely)

Couldn't start up the remote connection by executing

    ssh -C [email protected] rdiff-backup --server

Remember that, under the default settings, rdiff-backup must be
installed in the PATH on the remote system.  See the man page for more
information on this.  This message may also be displayed if the remote
version of rdiff-backup is quite different from the local version (1.2.8).

答案1

问题是您的服务器正在运行 bash 作为 shell,而不是rdiff-backup --server(它可以理解其'oh(crdiff_backup.connection'命令)。对我来说,解决方案是:

  • 更改远程模式以包含命令,即ssh -C %s -p 24752 rdiff-backup --server
  • 在远程端设置 ssh 强制命令rdiff-backup --server(如果您在脚本中使用它,也会更安全一些)。

相关内容