Class: Backup::Storage::SFTP

Inherits:
Base
  • Object
show all
Includes:
Cycler
Defined in:
lib/backup/storage/sftp.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#keep, #model, #package, #path, #storage_id

Instance Method Summary collapse

Methods inherited from Base

#perform!

Methods included from Config::Helpers

included

Constructor Details

#initialize(model, storage_id = nil) ⇒ SFTP

Returns a new instance of SFTP.



16
17
18
19
20
21
22
23
# File 'lib/backup/storage/sftp.rb', line 16

def initialize(model, storage_id = nil)
  super

  @ssh_options ||= {}
  @port        ||= 22
  @path        ||= "backups"
  path.sub!(/^~\//, "")
end

Dynamic Method Handling

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

Instance Attribute Details

#ipObject

Server IP Address and SFTP port



14
15
16
# File 'lib/backup/storage/sftp.rb', line 14

def ip
  @ip
end

#passwordObject

Server credentials



10
11
12
# File 'lib/backup/storage/sftp.rb', line 10

def password
  @password
end

#portObject

Server IP Address and SFTP port



14
15
16
# File 'lib/backup/storage/sftp.rb', line 14

def port
  @port
end

#ssh_optionsObject

Server credentials



10
11
12
# File 'lib/backup/storage/sftp.rb', line 10

def ssh_options
  @ssh_options
end

#usernameObject

Server credentials



10
11
12
# File 'lib/backup/storage/sftp.rb', line 10

def username
  @username
end