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, defaultfalse
:recursive
- set totrue
for copying directories, defaultfalse
:preserve
- preserve timestamps, defaultfalse
: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
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)
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)