Class: Backup::Storage::SCP

Inherits:
Base
  • Object
show all
Defined in:
lib/backup/storage/scp.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#keep, #storage_id

Instance Method Summary collapse

Methods inherited from Base

#perform!

Methods included from Configuration::Helpers

included

Constructor Details

#initialize(model, storage_id = nil, &block) ⇒ SCP

Creates a new instance of the storage object



27
28
29
30
31
32
33
34
35
36
# File 'lib/backup/storage/scp.rb', line 27

def initialize(model, storage_id = nil, &block)
  super(model, storage_id)

  @port ||= 22
  @path ||= 'backups'

  instance_eval(&block) if block_given?

  @path = path.sub(/^\~\//, '')
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Backup::Configuration::Helpers

Instance Attribute Details

#ipObject

Server IP Address and SCP port



19
20
21
# File 'lib/backup/storage/scp.rb', line 19

def ip
  @ip
end

#passwordObject

Server credentials



15
16
17
# File 'lib/backup/storage/scp.rb', line 15

def password
  @password
end

#pathObject

Path to store backups to



23
24
25
# File 'lib/backup/storage/scp.rb', line 23

def path
  @path
end

#portObject

Server IP Address and SCP port



19
20
21
# File 'lib/backup/storage/scp.rb', line 19

def port
  @port
end

#usernameObject

Server credentials



15
16
17
# File 'lib/backup/storage/scp.rb', line 15

def username
  @username
end