Class: Mysql
- Includes:
- Utils
- Defined in:
- lib/cryo/database/mysql.rb
Overview
this has all of the logic to perform an entire dump of a remote rds host
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#local_path ⇒ Object
Returns the value of attribute local_path.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#tmp_path ⇒ Object
Returns the value of attribute tmp_path.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#get_backup ⇒ Object
run through all of the necessary steps to perform a backup.
- #get_gzipped_backup ⇒ Object
-
#initialize(opts = {}) ⇒ Mysql
constructor
A new instance of Mysql.
Methods included from Utils
#delete_file, #get_age_from_key_name, #get_tempfile, #get_timstamped_key_name, #get_utc_time, #get_utc_time_from_key_name, #get_utc_timestamp, #gzip_file, #need_to_archive?, #safe_run, #ungzip_file, #verify_system_dependency
Methods inherited from Database
Constructor Details
#initialize(opts = {}) ⇒ Mysql
Returns a new instance of Mysql.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/cryo/database/mysql.rb', line 8 def initialize(opts={}) raise "you need to specify a password" unless opts[:password] self.password = opts[:password] raise "you need to specify a host" unless opts[:host] self.host = opts[:host] raise "you need to specify a tmp path" unless opts[:tmp_path] self.tmp_path = opts[:tmp_path] self.user = opts[:user] || 'ubuntu' self.port = opts[:port] || '3306' self.local_path = opts[:local_path] || get_tempfile verify_system_dependency 'mysqldump' end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
6 7 8 |
# File 'lib/cryo/database/mysql.rb', line 6 def host @host end |
#local_path ⇒ Object
Returns the value of attribute local_path.
6 7 8 |
# File 'lib/cryo/database/mysql.rb', line 6 def local_path @local_path end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/cryo/database/mysql.rb', line 6 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
6 7 8 |
# File 'lib/cryo/database/mysql.rb', line 6 def port @port end |
#tmp_path ⇒ Object
Returns the value of attribute tmp_path.
6 7 8 |
# File 'lib/cryo/database/mysql.rb', line 6 def tmp_path @tmp_path end |
#user ⇒ Object
Returns the value of attribute user.
6 7 8 |
# File 'lib/cryo/database/mysql.rb', line 6 def user @user end |
Instance Method Details
#get_backup ⇒ Object
run through all of the necessary steps to perform a backup
22 23 24 25 |
# File 'lib/cryo/database/mysql.rb', line 22 def get_backup() get_dump local_path end |
#get_gzipped_backup ⇒ Object
27 28 29 30 |
# File 'lib/cryo/database/mysql.rb', line 27 def get_gzipped_backup get_and_gzip_dump local_path end |