D
D
DVoropaev2019-08-16 11:55:42
linux
DVoropaev, 2019-08-16 11:55:42

How to determine which program is generating a file in Linux?

Let's consider 2 situations:
1) The file has already been created, and it is necessary to determine which program creates it
2) The file is generated with a certain frequency (say, every 10 minutes). It is necessary to "intercept" this moment and find out what kind of program creates it

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Adamos, 2019-08-16
@Adamos

While the program is working with the file, it keeps it open. Monitor lsof.
Or, if you suspect a particular program, run it as a unique user. The files it creates will be owned by that user.

V
vreitech, 2019-08-16
@fzfx

in the first case, set up an audit in advance and look for a file access event in /var/log/audit.log
; in the second case, inotify.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question