2

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")
    }

toy
  • 11,711
  • 24
  • 93
  • 176

1 Answers1

2

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")
}
Ji Zhou
  • 421
  • 2
  • 5
  • I managed to get mine to work the same way as you do as well. :-) Thanks anyway. – toy Mar 28 '12 at 13:26