Jay Taylor's notes
back to listing indexlinux - Find out which process is writing into a specific directory - Server Fault
[web search]Stack Exchange Network
Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack ExchangeI have a directory /some/dir, and I see that new files appear there all the time. How do I find out which process is creating those files?
Use kernel audit
subsystem
auditctl -w /some/dir/ -p war -k whatsgoingon
That sets up a hook waiting for something happening under /some/dir/.
Then make sure you have auditd
daemon running. After that just wait until files appear and see from /var/log/auditd.log
or wherever it in your system writes and read what happened and by what process.
auditctl -D
. You may use auditctl -l
to list all hooks.
– Robert
Mar 27 '19 at 9:08
Try lsof +r2 | grep '/some/dir'
. This will show processes accessing /some/dir and refresh every 2 seconds.
lsof
can help:
# lsof -r1 /some/dir/*
Your Answer
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Not the answer you're looking for? Browse other questions tagged linux or ask your own question.
-
-
-
-
-
5
Related
Hot Network Questions
-
Which case is the right one?
-
Calculating overlap area that belong to each point in QGIS
-
Using algebraic geometry to understand class field theory
-
What are some useful use-cases for eval in Shell?
-
When Pesach falls on Motzei Shabbos, should women make Havdallah?
-
Is auto generated projects for embedded system the future?
-
On my license I am listed as Private Pilot, Airplane Multiengine Land, can I fly as PIC in a Single Engine Land aircraft?
-
Can meat spoil outside the fridge if it's baked into bread as a filling?
-
Africa just kept coming up
-
Does Kasmina, Enigma Sage replace planeswalker abilities?
-
Are purchasable animals OP?
-
Can I leave out details I don’t understand?
-
Slow shutter speed and image sharpness
-
How (if) are the hydrogen's "external" and "internal" wavefunction connected?
-
What are the cadences in minor keys?
-
What happened to ECC RAM?
-
How can I draw a vector field on a curve?
-
Securing API keys for a Twitter account for a program to be run on other PC's
-
Why has a rocket system like Starship never been proposed before? It does not seem to use any new science, materials or fuels
-
Forest package: multiple lines in a leaf
-
What type of screws/anchors to fasten a closer to a steel door
-
Could a Titan-like moon orbit a terrestrial planet?
-
What benefits does a tent give a character?
-
Intuition behind Group Action