A
A
Andrey Ovsyankin2014-02-12 09:35:23
Data synchronization
Andrey Ovsyankin, 2014-02-12 09:35:23

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

3 answer(s)
I
ivankomolin, 2014-02-12
@EvilBeaver

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.

A
Andrey Gurtovoy, 2014-02-12
@jt3k

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)

V
Vlad Zhivotnev, 2014-02-12
@inkvizitor68sl

git, after the end of the script, commit the contents. Everything uncommitted is new.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question