Sha256: 3c7e4a4429cbd90989f9561785a99b9c209521c5bf96c6f562511f268e48b235

Contents?: true

Size: 785 Bytes

Versions: 3

Compression:

Stored size: 785 Bytes

Contents

module EY
  module Backup
    class Loader < Base
      include Logging

      def self.run(database, index)
        new(database, index).run
      end

      def self.download(database, index)
        new(database, index).download
      end

      def initialize(database, index)
        @database, @index = database, index
      end

      def run
        
        backup = download
        mode = backup.basename =~ /.gpz$/ ? "Downloading" : "Restoring"
        info "#{mode} #{@database.name}"
        backup.load!
        backup.remove_joined_file!
      end

      def download
        FileUtils.mkdir_p(EY::Backup.tmp_dir)

        backup = BackupSet.download(@database, @index)
        backup.join!
        backup.remove_split_files!
        backup
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ey_cloud_server-1.5.0 lib/ey_backup/loader.rb
ey_cloud_server-1.4.61 lib/ey_backup/loader.rb
ey_cloud_server-1.4.60 lib/ey_backup/loader.rb