From 47ca548c6a69cb6cee6bd9871d14984234419632 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 7 Nov 2023 15:12:39 +0100 Subject: [PATCH] Truncating login logs --- lib/cr_vmware_tpl/handler/vm.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/cr_vmware_tpl/handler/vm.py b/lib/cr_vmware_tpl/handler/vm.py index 831ceb8..604e0cf 100644 --- a/lib/cr_vmware_tpl/handler/vm.py +++ b/lib/cr_vmware_tpl/handler/vm.py @@ -26,7 +26,7 @@ from fb_tools.errors import HandlerError, ExpectedHandlerError from .. import print_section_start, print_section_end from ..xlate import XLATOR -__version__ = '0.2.4' +__version__ = '0.2.5' LOG = logging.getLogger(__name__) @@ -348,6 +348,12 @@ class HandlerVmMixin(): echo "Clearing journal log ..." journalctl --rotate --vacuum-time=2s + echo + echo "-----------------------------------------------------------" + echo "Truncating /var/log/*tmp ..." + cp -v /dev/null /var/log/btmp + cp -v /dev/null /var/log/wtmp + echo echo "-----------------------------------------------------------" echo "Remaining files in /var/log:" @@ -425,6 +431,12 @@ class HandlerVmMixin(): echo "Clearing journal log ..." journalctl --rotate --vacuum-time=2s + echo + echo "-----------------------------------------------------------" + echo "Truncating /var/log/*tmp ..." + cp -v /dev/null /var/log/btmp + cp -v /dev/null /var/log/wtmp + echo echo "Sleeping some seconds ..." sleep 3 -- 2.39.5