Method: MysqlManager::CommandLine#execute

Defined in:
lib/mysql_manager/command_line.rb

#executeObject



258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/mysql_manager/command_line.rb', line 258

def execute
  @options.each do |type,options|
    next if options.instance_of?(Hash) && options.has_key?(:execute) && options[:execute] == false
    begin
      case type
      when :kill
        @log.debug("about to call kill_queries")
        @utilities.kill_queries(options)
      when :skip_replication_errors
        @log.debug("about to call skip_replication_errors")
        @utilities.skip_replication_errors(options)
      when :reload_my_cnf
        @log.debug("about to call reload_my_cnf")
        @utilities.reload_my_cnf(options)
      when :hotcopy
        @log.debug("about to call hotcopy")
        @utilities.hotcopy(options)
      end
    rescue DBI::DatabaseError => e
      @log.fatal(e.message)
      exit(1)
    rescue FileNotFoundException => e
      @log.fatal(e.message)
      exit(1)
    rescue Interrupt
      @log.info("Exiting")
      exit
    rescue Exception => e
      #@log.fatal(e.message + "\n" + e.backtrace.join("\n"))
      @log.fatal(e.message)
      exit(1)
    end
  end
end