1

I need to get a full list of files modified, and if possible files accessed too, by a complex script, as well as all files accessed at the same time of the script running by any other process.

So i want to START logging all IO file access before the application start, and then STOP logging when it ends. (or inspect full log between 2 time stamps ?)

How can i do that ?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
sharp12345
  • 197
  • 1
  • 4
  • 8

1 Answers1

4

You could use a marker file, touching it before you perform the operation of your main concern, and then using the find command with the -newer or -anewer options to find files that were modified or access after you touched the marker file.

touch /tmp/marker
perform-some-operation
find /path/to/dir -newer /tmp/marker

If the directory you want to monitor is not too large, an interesting alternative could be to convert it to a Git repository, and then use Git commands to see what has changed.

cd /path/to/dir
git init .
git add .
git commit -m init
perform-some-operation
git status
git diff

After you are done, you can simply delete the .git directory.

janos
  • 11,171
  • 3
  • 35
  • 53