diff options
Diffstat (limited to 'clean-logs.sh')
-rwxr-xr-x | clean-logs.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clean-logs.sh b/clean-logs.sh index 5d79011..2d31c87 100755 --- a/clean-logs.sh +++ b/clean-logs.sh @@ -11,6 +11,9 @@ find /var/log/ -type f -name "*.gz" -exec rm -f {} \; find /var/log/ -type f -name "*.1" -exec rm -f {} \; find /var/log/ -type f -name "*.old" -exec rm -f {} \; +# rhel like logs with 8 digit date at the end +find /var/log -type f -regextype egrep -regex ".*-[0-9]{8}$" -exec rm -f {} \; + # clean systemd's journal if [[ -d /var/log/journal || -d /run/log/journal/ ]]; then systemctl stop systemd-journald |