add journalctl vacuum to armbian-truncate-logs (#2224)

This commit is contained in:
lanefu 2020-09-26 02:29:50 +00:00 committed by GitHub
parent 9637d3d0f9
commit c6e01744e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,4 +27,6 @@ if [ $logusage -ge $treshold ]; then
/usr/bin/find /var/log -name 'mail.err' -or -name 'mail.info' -or -name 'mail.warning' | xargs -r truncate --size 0
# remove
/usr/bin/find /var/log -name '*.[0-9]' -or -name '*.gz' | xargs -r rm -f
# rotate and vacuum systemd-journal
/usr/bin/journalctl --vacuum-size=5M --rotate
fi