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>
This commit is contained in:
SK
2021-11-07 09:31:28 -06:00
parent a5d5533acf
commit 880d9b9574

View File

@ -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)