|
3 | 3 | The primary public API for this library is the following set of functions:
|
4 | 4 |
|
5 | 5 | - `clj-libssh2.ssh/exec` - Execute a command on the remote host.
|
| 6 | +- `clj-libssh2.ssh/scp-from` - SCP a file from the remote host. |
| 7 | +- `clj-libssh2.ssh/scp-to` - SCP a file to the remote host. |
6 | 8 | - `clj-libssh2.ssh/with-session` - A convenience macro for managing sessions.
|
7 | 9 |
|
8 | 10 | If there are any breaking changes to the above-named functions after version
|
@@ -44,3 +46,25 @@ user=> (ssh/exec {:hostname "127.0.0.1"}
|
44 | 46 | {:out "foo\nbar\n", :err "", :exit 0, :signal {:exit-signal nil, :err-msg nil,
|
45 | 47 | :lang-tag nil}}
|
46 | 48 | ```
|
| 49 | + |
| 50 | +### Copy a file from a remote machine. |
| 51 | + |
| 52 | +```clojure |
| 53 | +user=> (require '[clj-libssh2.ssh :as ssh]) |
| 54 | +nil |
| 55 | +user=> (ssh/scp-from {:hostname "127.0.0.1"} "/home/conor/.vimrc" ".vimrc") |
| 56 | +{:local-path ".vimrc", :remote-path "/home/conor/.vimrc", :size 4525, |
| 57 | +:remote-stat {:atime #object[java.time.Instant 0x3fc52110 |
| 58 | +"2016-01-30T23:16:16Z"], :ctime #object[java.time.Instant 0x6de7c794 |
| 59 | +"1970-01-01T00:00:00Z"], :gid 0, :mode 420, :mtime #object[java.time.Instant |
| 60 | +0x3e81f5e4 "2016-01-30T17:58:11Z"], :size 4525, :uid 0}} |
| 61 | +``` |
| 62 | + |
| 63 | +### Send a file to a remote machine. |
| 64 | + |
| 65 | +```clojure |
| 66 | +user=> (require '[clj-libssh2.ssh :as ssh]) |
| 67 | +nil |
| 68 | +user=> (ssh/scp-to {:hostname "127.0.0.1"} "/home/conor/.vimrc" "/tmp/.vimrc") |
| 69 | +nil |
| 70 | +``` |
0 commit comments