sshkit v0.3.0 SSHKit.SCP View Source

Provides convenience functions for transferring files or directory trees to or from a remote host via SCP.

Built on top of SSHKit.SSH.

Common options

These options are available for both uploads and downloads:

  • :verbose - let the remote scp process be verbose, default false
  • :recursive - set to true for copying directories, default false
  • :preserve - preserve timestamps, default false
  • :timeout - timeout in milliseconds, default :infinity

Examples

{:ok, conn} = SSHKit.SSH.connect("eg.io", user: "me")
:ok = SSHKit.SCP.upload(conn, ".", "/home/code/phx", recursive: true)
:ok = SSHKit.SSH.close(conn)

Link to this section Summary

Functions

Downloads a file or directory from a remote host.

Uploads a local file or directory to a remote host.

Link to this section Functions

Link to this function

download(connection, source, target, options \\ [])

View Source

Downloads a file or directory from a remote host.

Options

See SSHKit.SCP.Download.transfer/4.

Example

:ok = SSHKit.SCP.download(conn, "/home/code/sshkit", "downloads", recursive: true)
Link to this function

upload(connection, source, target, options \\ [])

View Source

Uploads a local file or directory to a remote host.

Options

See SSHKit.SCP.Upload.transfer/4.

Example

:ok = SSHKit.SCP.upload(conn, ".", "/home/code/sshkit", recursive: true)