Class: Brillo::Dumper::MysqlDumper
- Inherits:
-
Object
- Object
- Brillo::Dumper::MysqlDumper
- Includes:
- Helpers::ExecHelper, Logger
- Defined in:
- lib/brillo/dumper/mysql_dumper.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize(config) ⇒ MysqlDumper
constructor
A new instance of MysqlDumper.
Methods included from Logger
Methods included from Helpers::ExecHelper
Constructor Details
#initialize(config) ⇒ MysqlDumper
Returns a new instance of MysqlDumper.
7 8 9 |
# File 'lib/brillo/dumper/mysql_dumper.rb', line 7 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
6 7 8 |
# File 'lib/brillo/dumper/mysql_dumper.rb', line 6 def config @config end |
Instance Method Details
#dump ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/brillo/dumper/mysql_dumper.rb', line 11 def dump db = config.db execute!( "mysqldump", host_arg, "-u #{db["username"]}", password_arg, "--no-data", "--single-transaction", # InnoDB only. Prevent MySQL locking the whole database during dump. "#{db["database"]}", "> #{config.dump_path}" ) end |