chore(systemd): extend commands for cleaning up

This commit is contained in:
Michele Cereda
2025-08-21 21:24:28 +02:00
parent 8a8fc4d1d7
commit d18a7f2a28
2 changed files with 22 additions and 0 deletions

View File

@@ -16,3 +16,18 @@ sudo hostnamectl set-hostname --pretty 'prometheus'
sudo systemctl list-units --state='failed'
sudo systemctl hybrid-sleep && exit
# Check how much space is taken up by logs
sudo journalctl --disk-usage
sudo du -sh '/var/log/journal'
# Rotate journal files.
# Marks the journal logs currently active as archive, and creates fresh new logs.
sudo journalctl --rotate
# Delete journal entries older than some time
sudo journalctl --vacuum-time='2d'
# Restrict logs up to some size.
# Deletes log files until the disk space they take falls below the specified size.
sudo journalctl --vacuum-size='100M'