2

我正在尝试将目录 scp 到远程服务器,但出现此错误。请帮忙

只需要 [file|localfile|remotefile] 之一或一个或多个嵌套文件集。


    ant.scp(todir:"user@mycompany.com:/home/user/db",keyfile:"test.pem") {
        fileset(dir:"/home/test")
    }

4

1 回答 1

2

您使用哪个版本的 ant 和 groovy?我使用 ant 1.8.2、groovy 1.8.6、jsch 0.1.46、ant-jsch 1.6.2、ant 这个脚本确实有效:

ant = new AntBuilder()
ant.scp(todir:"user1@mycorp.com:~/temp",keyfile:"/tmp/user1.pem",verbose:true, trust:true, passphrase:""){
    fileset(dir:"/user1/temp")
}
于 2012-03-28T09:59:56.327 回答