From 880d9b957472f7efe16e3af9c060e4b2a79dfa91 Mon Sep 17 00:00:00 2001 From: SK <74106733+skontrolle@users.noreply.github.com> Date: Sun, 7 Nov 2021 09:31:28 -0600 Subject: [PATCH] delete logs after rotation This commit deletes the logfile after compression. The current rotation keeps the logfiles which quickly fills up any zram compressed log mounts which will cause the pwnagotchi to hang. Signed-off-by: SK <74106733+skontrolle@users.noreply.github.com> --- pwnagotchi/log.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pwnagotchi/log.py b/pwnagotchi/log.py index f13e5d2b..00cc13b8 100644 --- a/pwnagotchi/log.py +++ b/pwnagotchi/log.py @@ -307,3 +307,5 @@ def do_rotate(filename, stats, cfg): with open(log_filename, 'rb') as src: with gzip.open(archive_filename, 'wb') as dst: dst.writelines(src) + + os.remove(log_filename)