gradle-ssh-plugin
gradle-ssh-plugin copied to clipboard
SCP file with a negative filter
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