Hi, I'm working on a project that monitors log files for keywords (long story short).
The one problem I'm facing right now is that the program creating and writing to the log files names them by date, creating one daily. Right now I have my Python script grabbing a file to read by the date format:
start_date = datetime.today().strftime('%Y%m%d')
main_run(start_date)```
but once it is the next day, the file is no longer being written to.
Furthermore I am using `sh` module to follow the file, and the script is held by a loop:
```py
# In "main_run" function:
tail_proc = tail("-f", "-n 0", path_1, _iter=False, _out=tail_callback, _bg=True)
tail_proc.wait()```
(I'm probably going to change the structure of the main starting function.)
How can I either break the loop by the next day, or when there is new file created, and start following the new file?