Skip to content

Instantly share code, notes, and snippets.

@pvaviloff
Last active December 15, 2022 18:59
Show Gist options
  • Save pvaviloff/9c3f0f72bd35128c0e97cab3822304d7 to your computer and use it in GitHub Desktop.
Save pvaviloff/9c3f0f72bd35128c0e97cab3822304d7 to your computer and use it in GitHub Desktop.
#! /bin/bash
echo ---- Start:
date
echo ----
sudo truncate /var/log/*log* --size 0
echo log files truncated
sudo rm /var/log/*.gz
echo gz files removed
sudo rm /tmp/trace.*.xt
echo trace files from tmp removed
journalctl --disk-usage
journalctl --vacuum-size=50M
journalctl --verify
journalctl --disk-usage
echo var/log/journal removed
echo ---- End:
date
echo ----
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment