ssh_dir_copy
Copy a directory recursively from one remote SSH server to another. Use it for remote-to-remote moves; choose a transfer tool for local-to-remote or remote-to-local copies.
Instructions
Copy a directory recursively (remote-to-remote; for local<->remote use ssh_dir_transfer instead).
overwrite controls what happens if destination_path already exists:
True: the entire existing destination directory is deleted first, then a fresh copy is made.False(default): does NOT block the copy - it copies into the existing destination as-is, merging with whatever's already there, and any file that shares a name with a source file gets silently overwritten anyway. This does NOT behave like the "fail if destination exists" semantics of ssh_file_move/ssh_file_copy's ownoverwriteparameter.
Returns:
{'status': 'success'/'error', 'files_copied' (int), 'bytes_copied' (int), 'destination_path'} (plus 'message' on error). Note: files_copied/
bytes_copied are computed by counting the destination directory's TOTAL
contents after the copy, not just the files newly copied in this call - if
merging into a non-empty destination, these counts include pre-existing files too.
Long-running calls: if this takes longer than the server's wait cap (default 50s), it
returns {"status": "in_progress", "handle_id": ...} instead of the result - the work keeps
running. Get the result by polling ssh_cmd_check_status(handle_id=...), which returns this
tool's normal response once finished. Do not call it again meanwhile. Only one such
operation runs at a time; another one started meanwhile fails with a 'busy' error.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| use_sudo | No | Use sudo for the operation | |
| overwrite | No | Overwrite existing files | |
| source_path | Yes | Source directory path | |
| destination_path | Yes | Destination directory path | |
| preserve_symlinks | No | Preserve symbolic links | |
| preserve_permissions | No | Preserve file permissions |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||