Just one suggestion (there are many possible solutions), but you could create a logging record for this. When the script successfully processes the file, log the date/time processed in a field in a new instance of the custom record type. You can add other useful info to the logging record if needed.
Then, schedule the script to run every hour for a 3 or 4 hour window (or however long is necessary) and have the script search for an instance of that custom record with a processed date/time on or after today’s date. If found, do nothing (return immediately). If not found, then proceed with the main script logic.
You can also create a cleanup script that deletes these records after some period of time, for example 60 days, or whenever they are no longer relevant