I'm trying to scp a directory to a remote server, but I'm getting this error. Please help

Exactly one of [file|localfile|remotefile] or one or more nested filesets is required.


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

有帮助吗?

解决方案

Which version of ant and groovy do you use? I use ant 1.8.2, groovy 1.8.6, jsch 0.1.46,ant-jsch 1.6.2, ant this script do works:

ant = new AntBuilder()
ant.scp(todir:"user1@mycorp.com:~/temp",keyfile:"/tmp/user1.pem",verbose:true, trust:true, passphrase:""){
    fileset(dir:"/user1/temp")
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top