Categories: How ToServers

Clear Systemd Journal Logs in Ubuntu 20.04 and above

Systemd has its own logging system called the journal, and the log files are stored in /var/log/journal.

Check current disk usage of journal files

sudo journalctl --disk-usage

Rotate journal files

  • Active journal files will be marked as archived, so that they are never written to in future.
sudo journalctl --rotate

Delete journal logs older than 5 days:

sudo journalctl --vacuum-time=5days

Delete log files until the disk space taken falls below 200M:

sudo journalctl --vacuum-size=200M

Delete old logs and limit file number to 10:

sudo journalctl --vacuum-files=10

The configuration file is located at /etc/systemd/journald.conf. After editing to your preference, reload systemd daemon using sudo systemctl daemon-reload

ferisetyawanmyid

🚀 Certified Linux System Administrator | DevOps | Server Optimization | Cybersecurity | DRC Solutions

Recent Posts

How to Install CyberPanel on Ubuntu 24.04 LTS (Step-by-Step Guide)

CyberPanel is a modern web hosting control panel powered by OpenLiteSpeed, designed for high performance,…

7 months ago

Welcome to My Personal Blog

🚀 Certified Linux System Administrator | DevOps | Server Optimization | Cybersecurity | DRC Solutions…

7 months ago

10 Essential Linux Commands Every SysAdmin Should Know

As a Linux System Administrator, mastering the command line is key to efficiently managing servers,…

9 months ago

🚀 How to Install WireGuard with Docker on Ubuntu 24.04 (wg-easy Dashboard)

Introduction WireGuard is a fast, lightweight, and modern VPN protocol designed for simplicity and performance.If…

10 months ago

How To Install Certbot on Ubuntu 24.04: Set Up Let’s Encrypt for Apache and Nginx

Securing your website with HTTPS is essential for privacy, SEO ranking, and user trust. Let’s…

10 months ago

Best SSH Clients for Linux: Top Tools for Secure Remote Connections

If you manage Linux servers regularly, you know how important SSH (Secure Shell) is. Whether…

10 months ago

This website uses cookies.