Class: Backup::Storage::FTP

Inherits:
Base
  • Object
show all
Defined in:
lib/backup/storage/ftp.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

#clear_defaults!, #load_defaults!

Constructor Details

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

Creates a new instance of the storage object



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/backup/storage/ftp.rb', line 29

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

  @port         ||= 21
  @path         ||= 'backups'
  @passive_mode ||= false

  instance_eval(&block) if block_given?

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

Instance Attribute Details

#ipObject

Server IP Address and FTP port



17
18
19
# File 'lib/backup/storage/ftp.rb', line 17

def ip
  @ip
end

#passive_modeObject

use passive mode?



25
26
27
# File 'lib/backup/storage/ftp.rb', line 25

def passive_mode
  @passive_mode
end

#passwordObject

Server credentials



13
14
15
# File 'lib/backup/storage/ftp.rb', line 13

def password
  @password
end

#pathObject

Path to store backups to



21
22
23
# File 'lib/backup/storage/ftp.rb', line 21

def path
  @path
end

#portObject

Server IP Address and FTP port



17
18
19
# File 'lib/backup/storage/ftp.rb', line 17

def port
  @port
end

#usernameObject

Server credentials



13
14
15
# File 'lib/backup/storage/ftp.rb', line 13

def username
  @username
end