Maintenance Task: Log Rotation Verification¶
Description¶
Ensure system logs are being rotated properly to prevent uncontrolled disk usage.
Frequency¶
Weekly or as part of monthly server checkup.
Checklist¶
- Is
logrotate
installed and active? - Are system and app logs rotating as expected?
- Are old logs compressed or deleted?
Verification Steps¶
- Test logrotate configuration:
logrotate --debug /etc/logrotate.conf
- Check status of rotated logs:
ls -lh /var/log/*.gz
- Review systemd journal size (if using
journald
):journalctl --disk-usage
Preventive Actions¶
- Configure
logrotate
for custom apps - Use compression and date-based rotations
- Vacuum
journald
logs:journalctl --vacuum-time=7d
Tools & Commands¶
logrotate
,journalctl
,ls
,du
, cron or systemd timers