Skip to content

Instantly share code, notes, and snippets.

@lifuzu
Created April 18, 2014 19:19
Show Gist options
  • Save lifuzu/11060208 to your computer and use it in GitHub Desktop.
Save lifuzu/11060208 to your computer and use it in GitHub Desktop.
using groovy to invoke curl
// Define cURL process with correct arguments.
def proc = "curl -o log/${day.format('yyyy-MM-dd')}.log "
+ "http://servername/import-data/${day.format('yyyy-MM-dd')}"
.execute()
// cURL uses error output stream for progress output.
Thread.start { System.err << proc.err }
// Wait until cURL process finished and continue with the loop.
proc.waitFor()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment