Class: Backup::Storage::RSync
- Includes:
- CLI
- Defined in:
- lib/backup/storage/rsync.rb
Instance Attribute Summary collapse
-
#ip ⇒ Object
Server IP Address and SSH port.
-
#password ⇒ Object
writeonly
Server credentials.
-
#path ⇒ Object
Path to store backups to.
-
#port ⇒ Object
Server IP Address and SSH port.
-
#username ⇒ Object
Server credentials.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(&block) ⇒ RSync
constructor
Creates a new instance of the RSync 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 included from CLI
#mkdir, #raise_if_command_not_found!, #rm, #run, #utility
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) ⇒ RSync
Creates a new instance of the RSync storage object First it sets the defaults (if any exist) and then evaluates the configuration block which may overwrite these defaults
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/backup/storage/rsync.rb', line 32 def initialize(&block) load_defaults! @port ||= 22 @path ||= 'backups' instance_eval(&block) if block_given? write_password_file! @time = TIME @path = path.sub(/^\~\//, '') end |
Instance Attribute Details
#ip ⇒ Object
Server IP Address and SSH port
22 23 24 |
# File 'lib/backup/storage/rsync.rb', line 22 def ip @ip end |
#password=(value) ⇒ Object
Server credentials
18 19 20 |
# File 'lib/backup/storage/rsync.rb', line 18 def password=(value) @password = value end |
#path ⇒ Object
Path to store backups to
26 27 28 |
# File 'lib/backup/storage/rsync.rb', line 26 def path @path end |
#port ⇒ Object
Server IP Address and SSH port
22 23 24 |
# File 'lib/backup/storage/rsync.rb', line 22 def port @port end |
#username ⇒ Object
Server credentials
18 19 20 |
# File 'lib/backup/storage/rsync.rb', line 18 def username @username end |
Instance Method Details
#perform! ⇒ Object
Performs the backup transfer
53 54 55 56 |
# File 'lib/backup/storage/rsync.rb', line 53 def perform! transfer! remove_password_file! end |
#remote_path ⇒ Object
This is the remote path to where the backup files will be stored
47 48 49 |
# File 'lib/backup/storage/rsync.rb', line 47 def remote_path File.join(path, TRIGGER) end |