Skip to content

Instantly share code, notes, and snippets.

@BrianJakovich
Created March 16, 2016 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrianJakovich/afcb65cc636836d6a76a to your computer and use it in GitHub Desktop.
Save BrianJakovich/afcb65cc636836d6a76a to your computer and use it in GitHub Desktop.
require "net/http"
require "uri"
uri = URI.parse("http://SERVERURL:8111/httpAuth/app/rest/server/backup")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri)
request.set_form_data({
"includeConfigs" => "true",
"includeDatabase" => "true",
"includeBuildLogs" => "true",
"fileName" => "ScheduledBackup"
})
request.basic_auth 'admin', 'password'
response = http.request(request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment