ssh_archive_create
Creates a compressed archive from a remote directory via SSH, supporting tar.gz and tar formats.
Instructions
Create a compressed archive from a directory.
IMPORTANT cross-platform caveat: on Windows, tar.gz/tar are NOT natively
available - requesting either one silently creates a .zip file instead (via
Compress-Archive), and archive_path's extension is auto-corrected to .zip
if needed. The only way to tell this happened is the returned format field
saying 'zip' even though you asked for tar.gz/tar. An archive created this
way on Windows can only be extracted with ssh_archive_extract on another Windows
host - Linux/macOS's extractor only recognizes .tar/.tar.gz/.tgz files, not
.zip. There is no cross-platform-portable archive format currently available
through this tool.
Returns:
On success: {'status': 'success', 'success': True, 'archive_created' (the actual path used, which may differ from archive_path if the extension was corrected on Windows), 'format' (the ACTUAL format used - 'tar.gz'/'tar' on Linux/macOS, always 'zip' on Windows), 'size_bytes'}. On failure:
{'status': 'error', 'message': 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 |
|---|---|---|---|
| format | No | Archive format | tar.gz |
| use_sudo | No | Use sudo for the operation | |
| source_path | Yes | Directory to archive | |
| archive_path | Yes | Path for the created archive |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||