Method: CloudFlock::App::Common#transfer_rsync
- Defined in:
- lib/cloudflock/app/common/servers.rb
#transfer_rsync(source_shell, dest_shell) ⇒ Object
Public: Transfer rsync from the destination host to the source host to facilitate the migration.
source_shell - SSH object logged in to the source host. dest_shell - SSH object logged in to the source host.
Returns a String.
599 600 601 602 603 604 605 606 607 608 609 |
# File 'lib/cloudflock/app/common/servers.rb', line 599 def transfer_rsync(source_shell, dest_shell) host = dest_shell.hostname location = dest_shell.as_root('which rsync') raise(NoRsyncAvailable, Errstr::NO_RSYNC) if location.empty? scp = "scp #{SSH_ARGUMENTS} -i #{PRIVATE_KEY} #{host}:#{location} " + "#{DATA_DIR}/" source_shell.as_root(scp) "#{DATA_DIR}/rsync" end |