Class: Dabcup::Operation::Dump

Inherits:
Base
  • Object
show all
Defined in:
lib/dabcup/operation/dump.rb

Instance Attribute Summary

Attributes inherited from Base

#database

Instance Method Summary collapse

Methods inherited from Base

#best_dumps_path, #best_local_dumps_path, #check, #initialize, #remove_local_dump?, #same_ssh_as_database?, #terminate

Constructor Details

This class inherits a constructor from Dabcup::Operation::Base

Instance Method Details

#run(args) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/dabcup/operation/dump.rb', line 4

def run(args)
  database.dump(dump_path)
  copy_dump_to_main_storage
  copy_dump_to_spare_storage
ensure
  path = local_dump_path || dump_path
  File.delete(path) if remove_local_dump? && File.exists?(path)
end