Class: Backup::Syncer::RSync::Local

Inherits:
Base
  • Object
show all
Defined in:
lib/backup/syncer/rsync/local.rb

Constant Summary

Constants included from CLI::Helpers

CLI::Helpers::UTILITY

Instance Attribute Summary

Attributes inherited from Base

#additional_options

Attributes inherited from Base

#directories, #mirror, #path

Instance Method Summary collapse

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

#initialize(&block) ⇒ Local

Instantiates a new RSync::Local Syncer object. Default configuration values and any specified in Backup::Configuration::Syncer::RSync::Local are set from Base. The user’s configuration file is then evaluated to overwrite these values or provide additional configuration.



14
15
16
17
18
# File 'lib/backup/syncer/rsync/local.rb', line 14

def initialize(&block)
  super

  instance_eval(&block) if block_given?
end

Instance Method Details

#perform!Object

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



23
24
25
26
27
28
29
30
31
32
# File 'lib/backup/syncer/rsync/local.rb', line 23

def perform!
  Logger.message(
    "#{ syncer_name } started syncing the following directories:\n\s\s" +
    @directories.join("\n\s\s")
  )
  Logger.silent(
    run("#{ utility(:rsync) } #{ options } " +
        "#{ directories_option } '#{ dest_path }'")
  )
end