From fc14b1b6a42fd7d6669824dbf97bd822d4cc9c91 Mon Sep 17 00:00:00 2001 From: Jun Futagawa Date: Wed, 1 Jul 2026 09:56:54 +0900 Subject: [PATCH] fix(packaging): enable default daily log rotation Enable daily log rotation in the packaged prec logrotate config and retain 7305 rotated files so the default policy covers about 20 years. Update README to document the installed default and note that rotate should be adjusted to match the operator's retention policy. Co-authored-by: Codex --- README.md | 6 ++++++ packaging/logrotate/prec | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a3932d8..762eb10 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,9 @@ apk add --allow-untrusted dist/prec_*_x86_64.apk pacman -U dist/prec-*-x86_64.pkg.tar.zst ``` +Package installs place `/etc/logrotate.d/prec` with a default policy of `daily` and `rotate 7305` (about 20 years of retention). +Adjust the `rotate` value as needed to match your retention policy. + ### Manual install from source Build the binaries first: @@ -173,6 +176,9 @@ install -m 0640 packaging/systemd/precd.service /usr/lib/systemd/system/ install -m 0640 packaging/logrotate/prec /etc/logrotate.d/prec ``` +The installed `/etc/logrotate.d/prec` default is `daily` with `rotate 7305` (about 20 years of retention). +Adjust the `rotate` value as needed to match your retention policy. + ### Enable and start precd ```bash diff --git a/packaging/logrotate/prec b/packaging/logrotate/prec index 4658f05..dd0fd25 100644 --- a/packaging/logrotate/prec +++ b/packaging/logrotate/prec @@ -1,6 +1,8 @@ /var/log/prec/prec.log { - # daily - # rotate 90 + daily + # Retain logs for up to 20 years by default. + # Adjust this value to match your organization's retention policy. + rotate 7305 # Log compression is enabled by default (compress = "zstd" in precd.conf), # so compressed rotated log files cannot be read with --all-logs. # If compress = "no" is set in precd.conf, using compress here is recommended.