background
There are too many log files in the production environment, resulting in insufficient disk space. Temporarily delete some systemctl logs to solve the problem.
step
First, stop systemd-journald
the service:
sudo systemctl stop systemd-journald
Clean the log files:
sudo journalctl --vacuum-size=100M
The above command will clean log files exceeding 100MB in size. You can adjust --vacuum-size
the parameter values as needed to set different cleaning thresholds.
Delete archived log files:
sudo journalctl --vacuum-time=7d
The above command will delete archived log files older than 7 days. You can adjust --vacuum-time
the parameter values as needed to set different time ranges.
Finally, restart systemd-journald
the service:
sudo systemctl start systemd-journald
After performing the above steps, systemd
the log files will be cleaned to free up disk space. Please note that these operations may require administrator rights to perform.