plaklet is a small, single-shot task executor built on
kloset. It reads one task description as
JSON on stdin, runs it (backup, check, …) against kloset connectors linked into
the binary, and streams the result back as JSON on stdout.
It is the execution engine that a driver spawns to actually do work — for example plakar-edge, which forwards tasks from a control plane to a remote network. plaklet itself is control-plane-agnostic: it has no dependency on plakman, only on kloset and a set of built-in connectors.
plaklet reads a single ExecPayload object on stdin and writes a stream of
ExecReply objects (one JSON object per line) on stdout, ending with a terminal
success or failure. The shapes are defined in protocol.go.
// stdout — a stream of ExecReply, terminal reply last
{"type":"report","report":{ "type":"backup", "backup": { … } }}
{"type":"success"}Connector secrets are expected to be already resolved into literal field values before the payload reaches plaklet.
| Op | Needs | Description |
|---|---|---|
backup |
source + target | Snapshot a source into a store |
check |
source (a store) | Verify every snapshot in a store |
restore |
source (a store) + target (a destination) | Export a snapshot to a destination |
sync |
source + target (both stores) | Copy snapshots from one store to another |
restore and sync select snapshots via task_config: snapshot (a specific
ID), latest ("true"), and tags (comma-separated). restore requires
exactly one match; sync copies every match the target does not already have.
Remaining operations (prune, maintenance) follow the same pattern and can be added in their own files.
The backends are linked in-process (see connectors.go) — the
same set the public plakar CLI ships: fs, http, ptar, stdio, tar.
Add an integration subpackage import to support more.
go build -o plaklet .
plaklet -cache /var/cache/plaklet -quiet < payload.json| Flag | Default | Meaning |
|---|---|---|
-cache |
(required) | Cache directory (pebble state cache) |
-cpu |
GOMAXPROCS-1 | Number of CPUs to use |
-concurrency |
NumCPU | Max backup/scan worker concurrency |
-quiet |
false | Quiet |
-pkg |
Reserved; connectors are linked in-process |