Answer the question
In order to leave comments, you need to log in
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
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.
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 — время последнего изменения файла (в минутах).
и тд
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question