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

#mirror, #path

Instance Method Summary collapse

Methods inherited from Base

#add, #directories

Methods included from Configuration::Helpers

included

Constructor Details

#initialize(&block) ⇒ Local

Instantiates a new RSync::Local Syncer.

Pre-configured defaults specified in Configuration::Syncer::RSync::Local are set via a super() call to RSync::Base, which in turn will invoke Syncer::Base.

Once pre-configured defaults and RSync specific defaults are set, the block from the user’s configuration file is evaluated.



18
19
20
21
22
# File 'lib/backup/syncer/rsync/local.rb', line 18

def initialize(&block)
  super

  instance_eval(&block) if block_given?
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Backup::Configuration::Helpers

Instance Method Details

#perform!Object

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



27
28
29
30
31
32
33
34
# File 'lib/backup/syncer/rsync/local.rb', line 27

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