Regain Disk Space by Pruning Journald Logs
Logging & Journald
Regain Disk Space by Pruning Journald Logs
🧩 The Challenge
Systemd journal files often grow indefinitely, consuming gigabytes of disk space on long-running servers. Manually deleting files in /var/log/journal is dangerous and can corrupt the logging database.
💡 The Fix
Use the built-in journalctl tool to restrict the journal size or duration, allowing the system to safely purge old records based on your specific storage requirements.
journalctl --vacuum-time=7d
journalctl --vacuum-size=500M
⚙️ Why It Works
These commands instruct journald to automatically delete archived logs older than seven days or trim the total storage usage to 500 megabytes, ensuring data integrity while freeing up space.
🚀 Pro-Tip: Use journalctl –disk-usage to quickly check exactly how much space your current logs are consuming.
Linux Tips & Tricks | © ngelinux.com | 7/5/2026
