From 556b5bed7d0e28f2b241a309fbaab4b3e4a6c406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 5 Jul 2024 21:10:52 -0300 Subject: [PATCH] core: tools: scripts: Add journalctl-vacuum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- core/tools/scripts/journalctl-vacuum | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 core/tools/scripts/journalctl-vacuum diff --git a/core/tools/scripts/journalctl-vacuum b/core/tools/scripts/journalctl-vacuum new file mode 100755 index 0000000000..349304c57c --- /dev/null +++ b/core/tools/scripts/journalctl-vacuum @@ -0,0 +1,8 @@ +#!/usr/local/bin/python +from commonwealth.utils.commands import run_command +from loguru import logger + +if __name__ == "__main__": + ret = run_command("journalctl --vacuum-size=100M", False) + logger.add("/tmp/journal-vacuum.log") + logger.debug(f"Command output: {ret}")