Creates a new instance of the MySQL adapter object
# File lib/backup/database/mysql.rb, line 41 def initialize(model, &block) super(model) @skip_tables ||= Array.new @only_tables ||= Array.new @additional_options ||= Array.new instance_eval(&block) if block_given? @name ||= :all @mysqldump_utility ||= utility(:mysqldump) end
Performs the mysqldump command and outputs the data to the specified path based on the 'trigger'
# File lib/backup/database/mysql.rb, line 57 def perform! super pipeline = Pipeline.new dump_ext = 'sql' pipeline << mysqldump if @model.compressor @model.compressor.compress_with do |command, ext| pipeline << command dump_ext << ext end end pipeline << "cat > '#{ File.join(@dump_path, dump_filename) }.#{ dump_ext }'" pipeline.run if pipeline.success? Logger.message "#{ database_name } Complete!" else raise Errors::Database::PipelineError, "#{ database_name } Dump Failed!\n" + pipeline.error_messages end end
Generated with the Darkfish Rdoc Generator 2.