Method: Backup::Database::OpenLDAP#perform!

Defined in:
lib/backup/database/openldap.rb

#perform!Object

Performs the slapcat command and outputs the data to the specified path based on the ‘trigger’



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/backup/database/openldap.rb', line 46

def perform!
  super

  pipeline = Pipeline.new
  dump_ext = 'ldif'

  pipeline << slapcat
  if @model.compressor
    @model.compressor.compress_with do |command, ext|
      pipeline << command
      dump_ext << ext
    end
  end

  pipeline << "#{ utility(:cat) } > " +
      "'#{ File.join(dump_path, dump_filename) }.#{ dump_ext }'"

  pipeline.run
  if pipeline.success?
    log!(:finished)
  else
    raise Error, "Dump Failed!\n" + pipeline.error_messages
  end
end