Reputation: 177
I want to write a python script which will keep track while transferring data from external USB to hard disk , I want to track the location of the data being transferred and the time at which the Process ends .(Through CLI) .
I have searched many places on internet but found nothing relevant. Any idea how can I start?
Upvotes: 0
Views: 45
Reputation: 743
There is actually a piece in the kernel that can monitor accesses to the filesystem and "notify" other processes whenever it happens
It is exported to c libraries, it is exported to python (and even bash!).
You can then find the other files that process access using:
lsof -p <PID>
Upvotes: 1