关于rsync调用的问题并不缺少,但我没有看到任何有助于我读过的十几个有用的东西,所以这是命令I 'm挣扎着:来自groovy的rsync:“-e”arg导致“未知的远程参数”错误
$ rsync -av -e 'ssh -i key.id_dsa -l root' [email protected]:/dir/file /tmp/file
它从bash工作。我使用String.execute()
方法调用它从Groovy代码和它如下失败:
command exit code: 1
rsync command output:
rsync command error output:
Unexpected remote arg: [email protected]:/dir/file
rsync error: syntax or usage error (code 1) at main.c(1348) [sender=3.1.0]
显然,-e
开关和它的值的问题是:命令如rsync -av -r --progress [email protected]:/dir/file /tmp/file
作品完美无缺。
问题0:为什么-e
参数特殊?
问题1:我如何使它工作?
可以尝试:'[“庆典”,“-c” ,“rsync -av -e'ssh -i key.id_dsa -l root'root @ server:/ dir/file/tmp/file”]。execute()'? –
@tim_yates您可以请您的评论一个答案,以便我可以upvote它并接受它? ( - ;谢谢,这是一个非常好的礼物,你在一个非常困难的日子给了我 –
顺便说一句,任何想法为什么'-e'开关看起来很特殊?使用引号指定参数吗? –