Methods

Class/Module Index [+]

Quicksearch

Backup::Database::Riak

Attributes

node[RW]

Node is the node from which to perform the backup. Default: riak@127.0.0.1

user[RW]

Username for the riak instance Default: riak

Public Class Methods

new(model, database_id = nil, &block) click to toggle source
# File lib/backup/database/riak.rb, line 21
def initialize(model, database_id = nil, &block)
  super
  instance_eval(&block) if block_given?

  @node   ||= 'riak@127.0.0.1'
  @cookie ||= 'riak'
  @user   ||= 'riak'
end

Public Instance Methods

perform!() click to toggle source

Performs the dump using `riak-admin backup`.

This will be stored in the final backup package as <trigger>/databases/-

# File lib/backup/database/riak.rb, line 35
def perform!
  super

  dump_file = File.join(dump_path, dump_filename)
  with_riak_owned_dump_path do
    run("#{ riakadmin } backup #{ node } #{ cookie } '#{ dump_file }' node")
  end

  model.compressor.compress_with do |command, ext|
    dump_file << "-#{ node }" # `riak-admin` appends `node` to the filename.
    run("#{ command } -c '#{ dump_file }' > '#{ dump_file + ext }'")
    FileUtils.rm_f(dump_file)
  end if model.compressor

  log!(:finished)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.