Top Level Namespace

Defined Under Namespace

Modules: Optimacms, OptimacmsBackups

Instance Method Summary collapse

Instance Method Details

#build_storage_local(local, options) ⇒ Object

helpers



40
41
42
43
44
45
46
# File 'lib/optimacms_backups/backup/init.rb', line 40

def build_storage_local(local, options)
  b = options

  local.path       = "#{b['path']}"
  local.keep       = 30
  # local.keep       = Time.now - 2592000 # Remove all backups older than 1 month.
end

#build_storage_s3(s3, opts) ⇒ Object



66
67
68
69
70
71
72
73
74
75
# File 'lib/optimacms_backups/backup/init.rb', line 66

def build_storage_s3(s3, opts)
  b = opts

  s3_config = $backup_config['s3']
  s3.access_key_id = b['access_key_id'] || s3_config['access_key_id']
  s3.secret_access_key = b['secret_access_key'] || s3_config['secret_access_key']
  s3.region = b['region'] || s3_config['region']
  s3.bucket = b['bucket'] || s3_config['bucket']
  s3.path = b['path'] || s3_config['path']
end

#build_storage_scp(server, opts) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/optimacms_backups/backup/init.rb', line 48

def build_storage_scp(server, opts)
  b = opts

  server.username = b['username']
  server.password = b['password']
  server.ip       = b['ip']
  server.port     = b['port']
  server.path     = b['path']

  # Use a number or a Time object to specify how many backups to keep.
  server.keep     = 30

  # Additional options for the SSH connection.
  # server.ssh_options = {}

end