Repository navigation
feat(linbo-remote): prune old per-run logs, rotate the run record - #185
Conversation
Per-run logs have unique names, so logrotate never rotates (and thus never deletes) the small ones, and its size rule would rotate a big one into an empty file of the same name. Keep them out of the existing *.log stanza with *[!0-9].log and let linbo-remote delete per-run logs older than 90 days when a new run starts (pruneRunLogs()). Rotate the run record linbo-remote_runs.jsonl monthly, keeping 12. Part 3 of #179. Signed-off-by: thomas@linuxmuster.net Assisted-by: Claude
4d79828 to
dd53957
Compare
352dbcc to
6f13ee0
Compare
|
Thanks for this. A review of the code, with the points a consumer (linuxmuster-api, webui7, edulution) runs into: Line references are to the files on the PR branches ( 1. 2. Record retention (12 months) is longer than log retention (90 days) ( 3. Legacy 4. Rotated naming for consumers. Without Checked and fine (no action): per-line appends are serialized by |
Part 3 of #179. Stacked on #184 (which is stacked on #183); retarget to
mainonce those are merged.pruneRunLogs()deletes per-run logs (<host>_linbo-remote_<timestamp>.log) older than 90 days (RUN_LOG_RETENTION_DAYS) when a new run starts. Best effort, only touches files matching the per-run name.size 50krule would rotate a large one into an empty file of the same name. The existing stanza therefore becomes*[!0-9].log, which leaves them out (all other logs are still matched, checked withlogrotate -don a live server).linbo-remote_runs.jsonlmonthly, 12 kept, compressed.rsync-*.logstayed.Refs #179
🤖 Generated with Claude Code