Class: SnapshotArchive::Stores::Mysql::Restore

Inherits:
Object
  • Object
show all
Defined in:
lib/snapshot_archive/stores.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata:) ⇒ Restore

Returns a new instance of Restore.



74
75
76
# File 'lib/snapshot_archive/stores.rb', line 74

def initialize(metadata:)
   = 
end

Instance Attribute Details

#metadataObject (readonly)

Returns the value of attribute metadata.



73
74
75
# File 'lib/snapshot_archive/stores.rb', line 73

def 
  
end

Class Method Details

.callObject



69
70
71
# File 'lib/snapshot_archive/stores.rb', line 69

def self.call(...)
  new(...).call
end

Instance Method Details

#callObject



78
79
80
81
82
# File 'lib/snapshot_archive/stores.rb', line 78

def call
  dump_path = .dig("path")
  Cfg.shell.debug("restoring #{metadata.to_json}")
  Cfg.shell.run("bash -ec 'zcat < #{dump_path} | mysql -uroot'")
end