From: Frank Brehm Date: Tue, 7 Nov 2023 14:12:39 +0000 (+0100) Subject: Truncating login logs X-Git-Tag: 3.2.1~28^2~2 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=47ca548c6a69cb6cee6bd9871d14984234419632;p=pixelpark%2Fcreate-vmware-tpl.git Truncating login logs --- 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