Class: Backup::Storage::SFTP
Instance Attribute Summary collapse
-
#ip ⇒ Object
Server IP Address and SFTP port.
-
#password ⇒ Object
Server credentials.
-
#path ⇒ Object
Path to store backups to.
-
#port ⇒ Object
Server IP Address and SFTP port.
-
#username ⇒ Object
Server credentials.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(&block) ⇒ SFTP
constructor
Creates a new instance of the SFTP storage object First it sets the defaults (if any exist) and then evaluates the configuration block which may overwrite these defaults.
-
#perform! ⇒ Object
Performs the backup transfer.
-
#remote_path ⇒ Object
This is the remote path to where the backup files will be stored.
Methods inherited from Base
#cycle!, #local_file, #local_path, #provider, #remote_file
Methods included from Configuration::Helpers
#clear_defaults!, #getter_methods, #load_defaults!, #setter_methods
Constructor Details
#initialize(&block) ⇒ SFTP
Creates a new instance of the SFTP storage object First it sets the defaults (if any exist) and then evaluates the configuration block which may overwrite these defaults
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/backup/storage/sftp.rb', line 27 def initialize(&block) load_defaults! @port ||= 22 @path ||= 'backups' instance_eval(&block) if block_given? @time = TIME @path = path.sub(/^\~\//, '') end |
Instance Attribute Details
#ip ⇒ Object
Server IP Address and SFTP port
17 18 19 |
# File 'lib/backup/storage/sftp.rb', line 17 def ip @ip end |
#password ⇒ Object
Server credentials
13 14 15 |
# File 'lib/backup/storage/sftp.rb', line 13 def password @password end |
#path ⇒ Object
Path to store backups to
21 22 23 |
# File 'lib/backup/storage/sftp.rb', line 21 def path @path end |
#port ⇒ Object
Server IP Address and SFTP port
17 18 19 |
# File 'lib/backup/storage/sftp.rb', line 17 def port @port end |
#username ⇒ Object
Server credentials
13 14 15 |
# File 'lib/backup/storage/sftp.rb', line 13 def username @username end |
Instance Method Details
#perform! ⇒ Object
Performs the backup transfer
47 48 49 50 |
# File 'lib/backup/storage/sftp.rb', line 47 def perform! transfer! cycle! end |
#remote_path ⇒ Object
This is the remote path to where the backup files will be stored
41 42 43 |
# File 'lib/backup/storage/sftp.rb', line 41 def remote_path File.join(path, TRIGGER) end |