Class: Backup::Syncer::RSync::Push
- Defined in:
- lib/backup/syncer/rsync/push.rb
Direct Known Subclasses
Constant Summary
Constants included from CLI::Helpers
Instance Attribute Summary collapse
-
#compress ⇒ Object
Flag for compressing (only compresses for the transfer).
-
#ip ⇒ Object
Server IP Address and SSH port.
-
#password ⇒ Object
Server credentials.
-
#port ⇒ Object
The SSH port to connect to.
-
#username ⇒ Object
Server credentials.
Attributes inherited from Base
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(&block) ⇒ Push
constructor
Instantiates a new RSync::Push or RSync::Pull Syncer.
-
#perform! ⇒ Object
Performs the RSync:Push operation debug options: -vhP.
Methods inherited from Base
Methods included from Configuration::Helpers
Constructor Details
#initialize(&block) ⇒ Push
Instantiates a new RSync::Push or RSync::Pull Syncer.
Pre-configured defaults specified in Configuration::Syncer::RSync::Push or Configuration::Syncer::RSync::Pull 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.
35 36 37 38 39 40 41 42 |
# File 'lib/backup/syncer/rsync/push.rb', line 35 def initialize(&block) super @port ||= 22 @compress ||= false 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 Attribute Details
#compress ⇒ Object
Flag for compressing (only compresses for the transfer)
22 23 24 |
# File 'lib/backup/syncer/rsync/push.rb', line 22 def compress @compress end |
#ip ⇒ Object
Server IP Address and SSH port
14 15 16 |
# File 'lib/backup/syncer/rsync/push.rb', line 14 def ip @ip end |
#password ⇒ Object
Server credentials
10 11 12 |
# File 'lib/backup/syncer/rsync/push.rb', line 10 def password @password end |
#port ⇒ Object
The SSH port to connect to
18 19 20 |
# File 'lib/backup/syncer/rsync/push.rb', line 18 def port @port end |
#username ⇒ Object
Server credentials
10 11 12 |
# File 'lib/backup/syncer/rsync/push.rb', line 10 def username @username end |
Instance Method Details
#perform! ⇒ Object
Performs the RSync:Push operation debug options: -vhP
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/backup/syncer/rsync/push.rb', line 47 def perform! write_password_file! Logger.( "#{ syncer_name } started syncing the following directories:\n\s\s" + @directories.join("\n\s\s") ) run("#{ utility(:rsync) } #{ } #{ directories_option } " + "'#{ username }@#{ ip }:#{ dest_path }'") ensure remove_password_file! end |