R
R
Roman Mirilaczvili2017-05-19 20:55:31
linux
Roman Mirilaczvili, 2017-05-19 20:55:31

How to periodically monitor changes in files in a directory in Linux?

A large archive of files is stored in some directory. After some time, not in real time, I want to be able to view a list of files that have been added / removed / changed (like the diff command for directories).
As I understand it, an index file or something like that should be created, so that then some utility can scroll through the list of files (or create HTML / TXT).
I want to manually carry out this operation every time before backing up data in order to check what needs to be stored and what not.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Erelecano Oioraen, 2017-05-20
@2ord

incron

R
RidgeA, 2017-05-19
@RidgeA

You can use a utility like inotify-tools, but if there are a lot of files, it can affect performance.
If it is enough to periodically check - then yes, create an index where to store the date of modification / creation of the file and something like its md5 hash.
Periodically, by krone - build a new index and check with the previous one.

V
Victor Taran, 2017-05-22
@shambler81

1.
if you need to synchronize it (I use a database)
2.
rcync- as a simpler option (has a built-in function)
3.

find  
-mtime — время последнего изменения файла (в днях).
-mmin — время последнего изменения файла (в минутах).
 и тд

Give a more detailed description of why you should follow, and perhaps there is a ready-made solution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question