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 ?

0

1 Answer 1

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.