server_file_write
Create or replace an entire file on a Docker host with optional backup, directory creation, and octal permission mode. Requires confirmation before writing.
Instructions
Create a file, or replace a whole file, on the Docker host. Needs confirm=true.
make_dirs creates missing folders. backup keeps the old file as .bak. mode is an optional octal mode such as 644 or 755 (for scripts). An existing file keeps its mode and owner. encoding is text, or base64 for binary files. For a small change to an existing file use server_file_edit instead: it never touches hidden secret lines.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | ||
| mode | No | ||
| path | Yes | ||
| backup | No | ||
| as_root | No | ||
| confirm | No | ||
| content | Yes | ||
| encoding | No | text | |
| make_dirs | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |