I'm aware that iftop monitors the network traffic on the current host, but is there a program that monitors the network traffic to a specified directory on the filesystem?
- 285
- 1
- 3
- 9
1 Answers
Hard truth
What you are requesting cannot be exactly done: you could write a software that could approximate that but that's about it.
Why?
The "network" cannot write anything in a folder: you must use a program for that like curl or firefox. The problem with a program such as firefox is that you have no idea, from the outside of it, whether a specific file it wrote is coming from the internet or not.
Having accurate information regarding that matter would require that every such program (i.e. able to write to disk from the network) actually report what they are doing somewhere. Unfortunately, this is not the case.
Approximation
An approximation of what you need would be to categorize programs as "internet writers" and "local writers" and then look at which program, in which category writes what and where. But as you may guess, this is no guarantee that the files written actually come from the internet.
Implementations
As far as I know, there are no implementations of such monitoring software though it is definitely possible to write one using inotify for instance to monitor changes in a specific folder and some logic about what is writing there (in order to categorize as "coming from the internet) and how much it writes (in order to have an idea of the traffic there).
- 308
- 2
- 9