Class: Mys3ql::Conductor
- Inherits:
-
Object
- Object
- Mys3ql::Conductor
- Defined in:
- lib/mys3ql/conductor.rb
Class Method Summary collapse
Instance Method Summary collapse
- #debug=(val) ⇒ Object
- #full ⇒ Object
- #incremental ⇒ Object
-
#initialize(config_file = nil) ⇒ Conductor
constructor
A new instance of Conductor.
-
#restore ⇒ Object
for now only restore from latest.
Constructor Details
Class Method Details
Instance Method Details
#debug=(val) ⇒ Object
54 55 56 |
# File 'lib/mys3ql/conductor.rb', line 54 def debug=(val) @config.debug = val end |
#full ⇒ Object
21 22 23 24 25 26 |
# File 'lib/mys3ql/conductor.rb', line 21 def full @mysql.dump @s3.store @mysql.dump_file @mysql.delete_dump @s3.delete_bin_logs end |
#incremental ⇒ Object
28 29 30 31 32 |
# File 'lib/mys3ql/conductor.rb', line 28 def incremental @mysql.each_bin_log do |log| @s3.store log, false end end |
#restore ⇒ Object
for now only restore from latest
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/mys3ql/conductor.rb', line 35 def restore # get latest dump with_temp_file do |file| @s3.retrieve :latest, file @mysql.restore file end # apply subsequent bin logs @s3.each_bin_log do |log| with_temp_file do |file| @s3.retrieve log, file @mysql.apply_bin_log file end end # NOTE: not sure about this: puts "You might want to flush mysql's logs..." end |