May 2013
Beginner to intermediate
384 pages
7h 40m
English
Logging of file and directory access is very helpful to keep a track of changes that are happening to files and folders. This recipe will describe how to log such accesses.
The inotifywait command can be used to gather information about file accesses. It doesn't come by default with every Linux distro. You have to install the inotify-tools package by using a package manager. It also requires the Linux kernel to be compiled with inotify support. Most of the new GNU/Linux distributions come with inotify enabled in the kernel.
Let's walk through the shell script to monitor the directory access:
#/bin/bash #Filename: watchdir.sh #Description: Watch directory access path=$1 #Provide ...
Read now
Unlock full access