ssh_upload
Upload local files or directories to a server, verified by sha256 and never left half-written; replace the target entirely or merge to preserve existing data.
Instructions
Copies a local file or directory to a server, checked by sha256 on both sides and never left half-written at the target. A directory replaces the target whole — whatever was there and is not in the source is gone with it; merge: true keeps it instead. For text you can paste, ssh_file_write is cheaper; piping base64 through ssh_exec truncates silently.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Octal, one value for every file sent. Omit to keep local permissions. | |
| sudo | No | For /etc, /opt and the like, and for setting an owner. Data stages in /tmp first — the machine needs room for a second copy. Default: false | |
| merge | No | Directories only. true = what the target holds and the source does not stays — uploads, .env, logs; same-named files are taken from the source. The tree is still put in place whole, by one rename. mode and owner then cover the kept files too. Default: false | |
| owner | No | "root:root", every file and directory sent. Needs sudo; without it the answer says it was not applied. | |
| verify | No | sha256 on both sides, per file. "unavailable" = no sha256 on the machine = delivered, not broken. "mismatched" fails the call and replaces nothing. Default: true | |
| profile | Yes | Machine name. | |
| timeout | No | Milliseconds. No ceiling by default — a transfer runs as long as it takes. | |
| overwrite | No | false = refuse rather than replace, including when the target cannot be checked. A directory is judged whole, not per file. Default: true | |
| recursive | No | Only to force it — a directory is recognised on its own. | |
| local_path | Yes | A file or a directory on this machine. | |
| remote_path | Yes | Where it goes on the server. A sent directory becomes this path itself and replaces it whole, not file by file — with merge: true what the source lacks stays. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | ||
| legend | No | What the words in this answer mean. A key names the field before the value — "state=limited", "jobs[].state=lost" — and only the values this answer actually used are listed. |