int128 / gradle-ssh-plugin

Gradle SSH Plugin
https://gradle-ssh-plugin.github.io
Apache License 2.0
318 stars 60 forks source link

SCP file with a negative filter #305

Open szaluk opened 6 years ago

szaluk commented 6 years ago

Environment info

id 'org.hidetake.ssh' version '2.9.0'

I am trying to scp files from a remote location and in the process I want to exclude a directory. I tried to add the following filter:

task test() {
    doLast {
        ssh.run {
            session(remotes.appBlade) {
                get from: '/remote/log/*', into: '/local/log', filter: { !(it.name =~ /soa$/) }
            }
        }
    }
}

The directory I want to exclude is called soa and it is a dead link (the directory it links to doesn't exist). Even with this filter set, I am getting the following:

* What went wrong:
Execution failed for task ':test'.
> Error while stream interaction: java.lang.IllegalStateException: SCP command returned error: scp: /remote/log/soa: No such file or directory

Is this an issue or am I doing it wrong?

Thanks, Steve