Skip to content

lynxpm flush

Terminal window
lynxpm flush [--namespace <ns>] [--json] <id|name|ns:*|*>...

Truncate the stdout/stderr log files for a process. Resolves and validates log paths before truncation to avoid unsafe operations. The human-readable output reports how many bytes were freed per target; --json surfaces the same number at .results[].extra.bytes_freed.

Bulk selectors:

  • <ns>:* — every process in that namespace. Quote the glob so the shell does not expand it: lynxpm flush 'prod:*'.
  • * or *:* — every managed process.
  • --namespace <ns> — same as <ns>:* but no shell quoting needed. Cannot be combined with positional targets.
FlagTypeDefaultDescription
--namespace <ns>string-Flush every process in this namespace. Mutually exclusive with positional targets.
--jsonbooleanfalseEmit a machine-readable {results, summary} batch report on stdout.
-h, --help--Show help message.

Flush logs for one process:

Terminal window
lynxpm flush my-api

Flush logs for multiple:

Terminal window
lynxpm flush api-1 api-2

Flush every process in the prod namespace:

Terminal window
lynxpm flush 'prod:*' # selector form (quote the glob)
lynxpm flush --namespace prod # flag form (script-friendly)

Total bytes reclaimed across a batch:

Terminal window
lynxpm flush api-1 api-2 --json | jq '[.results[].extra.bytes_freed] | add'
  • 0 — every target was flushed.
  • non-zero — at least one target failed; per-target lines (or .results[].error in --json) explain why.