ssh_file_copy
Copy a file from one remote path to another over SSH, with optional sudo and timestamped destination backups; use for remote-to-remote operations, not local transfers.
Instructions
Copy a file on the remote host (source and destination are both remote paths - for local<->remote transfers use ssh_file_transfer instead).
If append_timestamp=True, a timestamp is inserted before the destination's file
extension in the format %Y%m%dT%H%M%S, e.g. destination_path="/etc/hosts.bak"
becomes /etc/hosts.20260704T153045.bak - not appended after the extension, and
not configurable to a different format.
Returns:
On success: {'success': True, 'copied_to': <actual destination path used, including the timestamp if applied>}. On failure (source not found,
permission error): {'success': False, 'error': str} - not a raised
exception.
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 | |
| source_path | Yes | Source file path | |
| append_timestamp | No | Whether to append a timestamp to the destination | |
| destination_path | Yes | Destination file path |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||