Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jlebon/journald-janitor

Simple systemd service to prune old journal files based on boot events
https://github.com/jlebon/journald-janitor

Last synced: about 1 month ago
JSON representation

Simple systemd service to prune old journal files based on boot events

Awesome Lists containing this project

README

        

Currently there is no way to natively set up journald so
that logs are pruned based on boots. For example, you may
only want to keep journals for boot -1 and -2, not caring
about logs for older boots. This is an issue orthogonal to
time-based pruning since uptime can have various lengths.

This small package simply runs a quick script on boot to
delete journal files that hold logs for boots older than a
predefined limit (MAX_BOOTS in the script).

I also logged an RFE in upstream systemd for this:

https://github.com/systemd/systemd/issues/2070