Class: S3Backup::Pg::Backup
- Inherits:
-
Object
- Object
- S3Backup::Pg::Backup
- Defined in:
- lib/s3_backup/pg/backup.rb
Instance Attribute Summary collapse
-
#db_name ⇒ Object
readonly
Returns the value of attribute db_name.
Instance Method Summary collapse
-
#initialize(db_name) ⇒ Backup
constructor
A new instance of Backup.
- #now! ⇒ Object
Constructor Details
#initialize(db_name) ⇒ Backup
Returns a new instance of Backup.
6 7 8 |
# File 'lib/s3_backup/pg/backup.rb', line 6 def initialize(db_name) @db_name = db_name end |
Instance Attribute Details
#db_name ⇒ Object (readonly)
Returns the value of attribute db_name.
4 5 6 |
# File 'lib/s3_backup/pg/backup.rb', line 4 def db_name @db_name end |
Instance Method Details
#now! ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/s3_backup/pg/backup.rb', line 10 def now! puts 'Setup environement' set_pg_password_env puts 'Starting downloading dump ...' dump_database puts 'Dump downloaded.' puts 'Starting obfuscation ...' Obfuscate.new(pg_dump_file.path, .path).obfuscate_dump! puts 'Obfuscation done.' puts 'Upload to S3 ...' S3Backup::S3.new.upload!(obfucated_file_name, Config.s3_pg_path, .path) puts 'Uploaded.' puts 'Clean environement.' clean_env S3Backup::S3.new.clean!(db_name, Config.s3_pg_path) end |