Skip to content

Instantly share code, notes, and snippets.

@tsfreitas
Last active March 26, 2016 02:54
Show Gist options
  • Save tsfreitas/dd5d7ee8aea45ee06903 to your computer and use it in GitHub Desktop.
Save tsfreitas/dd5d7ee8aea45ee06903 to your computer and use it in GitHub Desktop.
Script de transferência por groovy
def server = "192.168.99.100"
def user = "root"
def remoteFile = "/data/log/my_file.log"
def localDirectory = "/my/local/path"
def ant = new AntBuilder()
ant.scp(
trust: "true",
file: "$user@$server:$remoteFile",
todir: localDirectory,
verbose: true,
port: 9199,
keyfile: "/Users/tsfreitas/.ssh/id_rsa",
passphrase: ""
)
println "FIM"
// É necessário duas dependências: com.jcraft:jsch:latest e ant:ant-jsch:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment