rsyslog and logrotate configuration for Alpine Linux
Find a file
2026-04-07 11:01:29 +02:00
etc/logrotate.script update 2026-04-07 11:01:29 +02:00
LICENSE Aggiungi LICENSE 2026-03-27 19:10:57 +00:00
README.md Aggiungi README.md 2026-03-27 19:11:40 +00:00
VERSION Aggiungi VERSION 2026-03-27 19:11:13 +00:00

snix-alpine-rsyslog

rsyslog and logrotate configuration for Alpine Linux.

Structure

etc/
  logrotate.script/
    helper     # archives a log to /var/log/logs before rotation, cleans entries older than 30 days
    convert    # adds prerotate helper block to all files in /etc/logrotate.d/

Flow

logrotate  →  prerotate  →  helper <name>  →  /var/log/logs/<name>.YYYY.MM.DD_HH.MM
                                            →  /var/log/<name>  (or <name>.log as fallback)

Usage

Run convert once to patch existing logrotate configs:

/etc/logrotate.script/convert

It skips files that already reference the helper.