Sha256: 1928c0518cecd57b18d370d60d3ec345d33d28e9b311c397a03c16aa265605f0

Contents?: true

Size: 603 Bytes

Versions: 12

Compression:

Stored size: 603 Bytes

Contents

require "pty"
module Mccloud
	module Util
		def self.rsync(path,vm,instance)
			command="rsync --delete -avz -e 'ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i \"#{vm.private_key}\"' '#{path}/' '#{vm.user}@#{instance.public_ip_address}:/tmp/#{File.basename(path)}/'"
			puts command
    begin
      PTY.spawn( command ) do |r, w, pid|
        begin
          r.each { |line| print line;}
       rescue Errno::EIO
       end
     end
   rescue PTY::ChildExited => e
      puts "The child process exited!"
			   end
			#Kernel.exec(command)
		end
	end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mccloud-0.0.13 lib/mccloud/util/rsync.rb
mccloud-0.0.12 lib/mccloud/util/rsync.rb
mccloud-0.0.11 lib/mccloud/util/rsync.rb
mccloud-0.0.10 lib/mccloud/util/rsync.rb
mccloud-0.0.9 lib/mccloud/util/rsync.rb
mccloud-0.0.8 lib/mccloud/util/rsync.rb
mccloud-0.0.7 lib/mccloud/util/rsync.rb
mccloud-0.0.6 lib/mccloud/util/rsync.rb
mccloud-0.0.5 lib/mccloud/util/rsync.rb
mccloud-0.0.4 lib/mccloud/util/rsync.rb
mccloud-0.0.3 lib/mccloud/util/rsync.rb
mccloud-0.0.2 lib/mccloud/util/rsync.rb