Class: Backup::Performer

Inherits:
Object
  • Object
show all
Defined in:
lib/backup-agent/performer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



3
4
5
# File 'lib/backup-agent/performer.rb', line 3

def config
  @config
end

#storageObject (readonly)

Returns the value of attribute storage.



3
4
5
# File 'lib/backup-agent/performer.rb', line 3

def storage
  @storage
end

Instance Method Details

#perform_backup(storage, config) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/backup-agent/performer.rb', line 5

def perform_backup(storage, config)
  @storage = storage
  @config = config
  @started_at = Time.now.utc
  @timestamp = @started_at.strftime('%s - %A %d %B %Y %H:%M')
  storage.open
  make_tmp_dir
  backup_mysql if Backup.features.mysql_installed?
  backup_mongodb if Backup.features.mongodb_installed?
  backup_directories
  backup_files
  cleanup_old_backups
ensure
  remove_tmp_dir
  storage.close
end