Method: Pike::SSH::Connection.scp

Defined in:
lib/pike/ssh/connection.rb

.scp(local, remote, host) ⇒ Object

Copies a file via scp to the remote server



82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/pike/ssh/connection.rb', line 82

def scp(local, remote, host)
  if ready?
    Logger.log "Uploading file #{local} to #{host}:#{remote} ..."

    begin
      @session.scp.upload!(File.expand_path(local), remote)
    rescue Exception => e
      Main.error('Something went wrong with scp.', e)
    end
  else
    connection_error
  end
end