Originally Posted by kabugima2
suppose you want to write a shell-script that outputs a periodic listing of owners of files that are active at given times during the day, so as to monitor who was logged in when some particular event occurred e.g when someone changed the contents of files, how would you achieve this ? please help!
I'd use cron to run it (or make the script sleep a certain time, then loop through), and a combination of who and lsof to do the task. I'd probably have a list of files I wanted monitored, either as a text file, or hard-coded in the script, so the lsof would just check those files, or grep for it.