-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore: prune old compressed log archives in ~/.local/state #94
Copy link
Copy link
Open
Description
Problem
Compressed log archives (.log-*.gz files from logrotate) accumulate indefinitely in /Users/operator/.local/state/. Files going back to January 2025 are still present.
While logrotate's rotate 30 setting limits the number of rotated files per log pattern, the archives are never cleaned up beyond that — and with multiple log sources, the directory grows over time.
Scope
Add automated pruning of old .gz archives in ~/.local/state/. Options:
- Add a
postrotatescript inconfig/logrotate.confthat deletes.gzfiles older than N days - Create a separate cleanup LaunchAgent/timer
- Extend the existing logrotate
postrotateblock (which already cleans up/tmpfiles)
Considerations
- Decide on retention policy (30 days? 90 days?)
- The
postrotateblock inconfig/logrotate.confalready runsfind /tmp -name "*.log" -mtime +7 -delete— extending it with a similar rule for~/.local/state/*.gzwould be the simplest approach - Should also consider whether the
delaycompress+rotate 30+dailysettings are producing more archives than intended
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels