Thursday 17 Jan 2013
This program is an "inotify cron" system. It consists of a daemon and a table manipulator. You can use it a similar way as the regular cron. The difference is that the inotify cron handles filesystem events rather than time periods.
apt-get install incron
sudo adduser thomas incron
If /etc/incron.allow exists only users listed here may use incron. Otherwise if /etc/incron.deny exists
The user table rows have the following syntax (use one or more spaces between elements):
\<path> \<mask> \<command>
\<path> is a filesystem path (each whitespace must be prepended by a backslash) \<mask> is a symbolic (see inotify.h; use commas for separating symbols) or numeric mask for events \<command> is an application or script to run on the events
The command may contain these wildcards:
\$\$ - a dollar sign \$@ - the watched filesystem path (see above) \$# - the event-related file name \$% - the event flags (textually) \$& - the event flags (numerically)
/etc/somefile IN_CLOSE_WRITE mail...
more event http://linux.die.net/man/7/inotify