From 9cb12880cc64d830ac2daf7c2346849b9e10ce89 Mon Sep 17 00:00:00 2001 From: datechnoman Date: Sat, 17 Feb 2024 12:59:49 +0000 Subject: [PATCH] Updated to 72 hour retention --- telegram_automated_cdx_processor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telegram_automated_cdx_processor.py b/telegram_automated_cdx_processor.py index d748c88..fbedb93 100644 --- a/telegram_automated_cdx_processor.py +++ b/telegram_automated_cdx_processor.py @@ -179,12 +179,12 @@ def main(): directory_output_file.write(f"{filename}\n") # Process older files in /opt/cdxfiles/telegram - older_than_48_hours = datetime.now() - timedelta(days=2) + older_than_72_hours = datetime.now() - timedelta(days=3) for filename in os.listdir(TELEGRAM_DIRECTORY): file_path = os.path.join(TELEGRAM_DIRECTORY, filename) if filename.endswith(".cdx.json") and os.path.getmtime(file_path) < older_than_48_hours.timestamp(): os.remove(file_path) - print(f"Deleted '{filename}' as it is older than 48 hours.") + print(f"Deleted '{filename}' as it is older than 72 hours.") run_ia_command() # Run IA command after processing older files