def download_data_from_tmp_rds
      @new_instance.wait_for { ready? }
      db_name = @original_server.db_name
      db_user = @original_server.master_username
      update_status "Dumping database #{db_name} from #{@new_instance.id}"
      dump_time   = @snapshot ? Time.parse(@snapshot.created_at.to_s) : Time.now
      date_stamp  = dump_time.strftime("%Y-%m-%d-%H%M%S")
      @sql_file = "#{@config['tmp_dir']}/#{@s3_path}/#{db_name}.#{date_stamp}.sql.gz"
      hostname  = @new_instance.endpoint['Address']
      dump_cmd  = "mysqldump -u #{db_user} -h #{hostname} "+
        "-p#{@new_password} #{db_name} | gzip >#{@sql_file}"
      FileUtils.mkpath(File.dirname @sql_file)
      @log.debug "Executing command: #{dump_cmd}"
      `#{dump_cmd}`
    end
def download_data_from_tmp_rds
      @new_instance.wait_for { ready? }
      db_name = @original_server.db_name
      db_user = @original_server.master_username
      update_status "Dumping database #{db_name} from #{@new_instance.id}"
      dump_time   = @snapshot ? Time.parse(@snapshot.created_at.to_s) : Time.now
      date_stamp  = dump_time.strftime("%Y-%m-%d-%H%M%S")
      @sql_file = "#{@config['tmp_dir']}/#{@s3_path}/#{db_name}.#{date_stamp}.sql.gz"
      hostname  = @new_instance.endpoint['Address']
      dump_cmd  = "mysqldump -u #{db_user} -h #{hostname} "+
        "-p#{@new_password} #{db_name} | gzip >#{@sql_file}"
      FileUtils.mkpath(File.dirname @sql_file)
      @log.debug "Executing command: #{dump_cmd}"
      `#{dump_cmd}`
    end
Connects to the RDS server, and dumps the database to a temp dir