Class: BRDB::BackupDatabase
- Inherits:
-
Object
- Object
- BRDB::BackupDatabase
- Defined in:
- lib/brdb.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ BackupDatabase
constructor
A new instance of BackupDatabase.
- #perform ⇒ Object
Constructor Details
#initialize ⇒ BackupDatabase
65 66 67 |
# File 'lib/brdb.rb', line 65 def initialize @backups_dir = "#{ENV['HOME']}/db_backups/" end |
Class Method Details
.run ⇒ Object
69 70 71 |
# File 'lib/brdb.rb', line 69 def self.run self.new.perform end |
Instance Method Details
#perform ⇒ Object
73 74 75 76 77 78 79 |
# File 'lib/brdb.rb', line 73 def perform return unless dbname puts 'performing backup...' `pg_dump #{dbname} > #{backup_filename}` puts "=> #{backup_filename}" end |