File Access Monitoring

From Indie IT Wiki
Jump to: navigation, search


Install software...

sudo aptitude install -y -v incron

Allow normal users...

sudo nano /etc/incron.allow

Create a Incrontab to monitor a folder...

incrontab -e

Add the lines like this...

/home/user/Folder/ IN_MODIFY /usr/local/bin/incronotify "$#"

Save and exit the Incrontab editor.

Create the notification shell script of your choosing...

sudo touch /usr/local/bin/incronotify
sudo chmod +x /usr/local/bin/incronotify
sudo nano /usr/local/bin/incronotify

echo "$@" |mail -s "Change in folder"

Then test it!

Custom Script

See this article.