kshitij chaurasiya
kshitij chaurasiya

Reputation: 177

How do i track the process of transferringt data from any external usb to PC (linux) ?

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

Answers (1)

I-V
I-V

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

Related Questions