From 8e1912cb9b4aea1d15296562faac5fc1efab9cfc Mon Sep 17 00:00:00 2001 From: datechnoman Date: Tue, 9 Jan 2024 21:13:48 +0000 Subject: [PATCH] Updated cdx file retention to 2 days --- mediafire_automated_cdx_processor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mediafire_automated_cdx_processor.py b/mediafire_automated_cdx_processor.py index db342aa..3fb1976 100644 --- a/mediafire_automated_cdx_processor.py +++ b/mediafire_automated_cdx_processor.py @@ -179,12 +179,12 @@ def main(): directory_output_file.write(f"{filename}\n") # Process older files in /opt/cdxfiles/mediafire - older_than_24_hours = datetime.now() - timedelta(days=1) + older_than_48_hours = datetime.now() - timedelta(days=2) for filename in os.listdir(MEDIAFIRE_DIRECTORY): file_path = os.path.join(MEDIAFIRE_DIRECTORY, filename) - if filename.endswith(".cdx.json") and os.path.getmtime(file_path) < older_than_24_hours.timestamp(): + 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 24 hours.") + print(f"Deleted '{filename}' as it is older than 48 hours.") run_ia_command() # Run IA command after processing older files