Situation
I have a directory /home/foo
on a server, and I guess that it is not needed any more.
Unfortunately nobody can tell me if this directory is still needed.
Goal
If this directory is still needed, I want to know which process accesses it.
Current Strategy
Watch all file opens below this directory.
Why not inotify
Unfortunately the directory contains a lot of sub-directories, that's why I don't want to use inotify.
- 1604508 files
- 287253 sub-directories
Question
How can I watch all file opens below a directory (recursive) tree? I want to know which process access it.
Environment
/home
is an ext4 filesystem.- SuSE Linux 12.3. Kernel: 3.7.10
Not duplicate
My question is not a duplicate of Is it possible to find out what program or script created a given file? since ....:
- I can't use inotify since the directory tree contains too many sub directories.
- I can't use loggedfs: I can't change the file system type of this directory.
Bounty
There are already two good answers. But I am curious, maybe there are other ways: Bounty of 50 :-)
/home/foo
? – dan May 12 '16 at 08:27/home/foo
is already a filesystem. I guess you mean "why couldn't you change the filesystem type?". Right? – guettli May 12 '16 at 08:33/home
not for/home/foo
. My idea was to suggest you to make an independant FS of/home/foo
and to track any/dev/rdiskn
raw device access. – dan May 12 '16 at 15:13syscall.open.return
probe (as you do not need to monitor reads and writes)...good luck! – vlp May 15 '16 at 21:30