Class: Rays::Service::Backup
- Inherits:
-
Object
- Object
- Rays::Service::Backup
- Defined in:
- lib/rays/services/backup_service.rb
Instance Method Summary collapse
- #backup ⇒ Object
-
#initialize(environment = $rays_config.environment) ⇒ Backup
constructor
A new instance of Backup.
Constructor Details
#initialize(environment = $rays_config.environment) ⇒ Backup
Returns a new instance of Backup.
28 29 30 31 32 33 |
# File 'lib/rays/services/backup_service.rb', line 28 def initialize(environment = $rays_config.environment) @environment = environment @backup_directory = create_backup_directory @dump_file_name = 'db.dump' @package_file = "archive-#{Time.now.to_i.to_s}.tar" end |
Instance Method Details
#backup ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/rays/services/backup_service.rb', line 35 def backup package = '' service_safe(@environment.backup.stop_server) do database data package = pack end package end |