1

How can I record all the modifications to directories, subdirectories and files made during one session (ie. during login time)?

For example, listing all the files/folders that were modified, and placing that information into a text file.

I have no idea how to do this, so even a little guidance would be useful...

TellMeWhy
  • 17,484
  • Do you want the modifications to persist? If not: http://askubuntu.com/a/548712/158442 What does Python have to do with this? – muru Dec 18 '15 at 22:06
  • @muru yes I do - wouldn't a script be needed? – TellMeWhy Dec 18 '15 at 22:08
  • 2
    inotify can tell you what changed, but not how it changed, and only with some limited recursion (though a large limit, I think): http://askubuntu.com/questions/543960/how-do-i-monitor-which-file-changes-during-changing-settings, http://askubuntu.com/a/541144/158442, http://stackoverflow.com/questions/8699293/how-to-monitor-a-complete-directory-tree-for-changes-in-linux – muru Dec 18 '15 at 22:10

1 Answers1

2

Use inotifywatch to collect statistics and redirect the output.

$ inotifywatch -r $HOME > /path/to/log

http://linux.die.net/man/1/inotifywatch

Or use inotifywait to get a change-by-change, file-by-file update.

$ inotifywait -mr $HOME > /path/to/log

http://linux.die.net/man/1/inotifywait

Ken Sharp
  • 991
  • 8
  • 31