Class: Backup::Syncer::RSync::Pull

Inherits:
Push show all
Defined in:
lib/backup/syncer/rsync/pull.rb

Constant Summary

Constants included from CLI::Helpers

CLI::Helpers::UTILITY

Instance Attribute Summary

Attributes inherited from Push

#compress, #ip, #password, #port, #username

Attributes inherited from Base

#additional_options

Attributes inherited from Base

#directories, #mirror, #path

Instance Method Summary collapse

Methods inherited from Push

#initialize

Methods inherited from Base

#initialize

Methods inherited from Base

#add

Methods included from Configuration::Helpers

#clear_defaults!, #load_defaults!

Methods included from CLI::Helpers

#command_name, #raise_if_command_failed!, #run, #utility

Constructor Details

This class inherits a constructor from Backup::Syncer::RSync::Push

Instance Method Details

#perform!Object

Performs the RSync::Pull operation debug options: -vhP



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/backup/syncer/rsync/pull.rb', line 11

def perform!
  write_password_file!

  @directories.each do |directory|
    Logger.message("#{ syncer_name } started syncing '#{ directory }'.")
    Logger.silent(
      run("#{ utility(:rsync) } #{ options } " +
          "'#{ username }@#{ ip }:#{ directory.sub(/^\~\//, '') }' " +
          "'#{ dest_path }'")
    )
  end

ensure
  remove_password_file!
end