Class: Backup::Storage::RSync

Inherits:
Base
  • Object
show all
Includes:
CLI::Helpers
Defined in:
lib/backup/storage/rsync.rb

Constant Summary

Constants included from CLI::Helpers

CLI::Helpers::UTILITY

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) ⇒ RSync

Creates a new instance of the storage object


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

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

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

  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 SSH port


18
19
20
# File 'lib/backup/storage/rsync.rb', line 18

def ip
  @ip
end

#localObject

Flag to use local backups


26
27
28
# File 'lib/backup/storage/rsync.rb', line 26

def local
  @local
end

#passwordObject

Server credentials


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

def password
  @password
end

#pathObject

Path to store backups to


22
23
24
# File 'lib/backup/storage/rsync.rb', line 22

def path
  @path
end

#portObject

Server IP Address and SSH port


18
19
20
# File 'lib/backup/storage/rsync.rb', line 18

def port
  @port
end

#usernameObject

Server credentials


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

def username
  @username
end