Creates a new instance of the Riak adapter object
# File lib/backup/database/riak.rb, line 28 def initialize(model, &block) super(model) instance_eval(&block) if block_given? @riak_admin_utility ||= utility('riak-admin') end
Performs the riak-admin command and outputs the data to the specified path based on the 'trigger'
# File lib/backup/database/riak.rb, line 39 def perform! super # have to make riak the owner since the riak-admin tool runs # as the riak user in a default setup. FileUtils.chown_R('riak', 'riak', @dump_path) backup_file = File.join(@dump_path, name) run("#{ riakadmin } #{ backup_file } node") if @model.compressor @model.compressor.compress_with do |command, ext| run("#{ command } -c #{ backup_file } > #{ backup_file + ext }") FileUtils.rm_f(backup_file) end end end
Generated with the Darkfish Rdoc Generator 2.