Answer the question
In order to leave comments, you need to log in
How to effectively find out what files are added to a folder (without constant monitoring)?
There is a program that collects some statistics from files in certain directories.
The catalogs are updated periodically. At the next launch of the program (about once every 2 weeks), you need to find out which files have not yet been processed by the program, i.e. you need to find directory changes since the last run.
How to do it the right way?
Answer the question
In order to leave comments, you need to log in
The most correct way is to write about it somewhere at the moment the program processes the file, and the next time before the program starts processing the file, check whether there is a record about it or not.
look at the creation date. and compare it with the date of the last run of the script.
(I noticed the "data synchronization" tag, for this, use rsync there is a fairly good algorithm that allows you not to copy what has already been copied)
git, after the end of the script, commit the contents. Everything uncommitted is new.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question