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 object.
-
#perform! ⇒ Object
Performs the RSync:Push operation debug options: -vhP.
Methods inherited from Base
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) ⇒ Push
Instantiates a new RSync::Push or RSync::Pull Syncer object. Default configuration values and any specified in Backup::Configuration::Syncer::RSync:: are set from Base. The user’s configuration file is then evaluated to overwrite these values or provide additional configuration.
30 31 32 33 34 35 36 37 |
# File 'lib/backup/syncer/rsync/push.rb', line 30 def initialize(&block) super @port ||= 22 @compress ||= false instance_eval(&block) if block_given? end |
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
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/backup/syncer/rsync/push.rb', line 42 def perform! write_password_file! Logger.( "#{ syncer_name } started syncing the following directories:\n\s\s" + @directories.join("\n\s\s") ) Logger.silent( run("#{ utility(:rsync) } #{ } #{ directories_option } " + "'#{ username }@#{ ip }:#{ dest_path }'") ) ensure remove_password_file! end |