Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python, how to setup hooks for tracing I/O Events

My app downloads files, creates files as final/intermediate data. I would like to setup a hook (outside the app), to alert/log whenever my app does any I/O events - like writing a file, deleting a file, downloading a file from the file server. I use the urllib to retrieve fits files from the data servers.

like image 848
json Avatar asked Jun 27 '26 17:06

json


1 Answers

If you know where the file will be downloaded to, one solution could be to use inotify. In particular, pyinotify seems interesting. I don't know if CentOS has a recent enough version of the Linux kernel for this to work though.

like image 105
Jason Baker Avatar answered Jun 30 '26 06:06

Jason Baker