incron documentation
Requirements
- Linux kernel 2.6.13 or later (with inotify compiled in)
- inotify headers (
inotify.h
,inotify-syscalls.h
) installed in<INCLUDE_DIR>/sys
. The most common place is/usr/include/sys
. On some distributions there is only one of these files (inotify.h
) which contains everything necessary. - GCC 4.x compiler (probably works also with GCC 3.4, possibly with older versions too)
Note: Downloading inotify-cxx is not necessary. Each incron source package contains the appropriate version of inotify-cxx.
How to build
Because this version is early it does not contain a standard portable build mechanism (such as for autotools). There is only a Makefile which must be modified manually. On many Linux systems you need not to change anything.
Please review the Makefile BEFORE you type 'make'. Especially check the PREFIX and other common variables. If done you can now build the files ('make').
incron binaries must be of course installed as root ('make install').
There are some special make targets:
- uninstall - Uninstalls the previously installed incron files. It doesn't remove any system and user tables.
- update - Updates your incron installation (equivalent to 'make uninstall install')
- release - Creates a source release. It creates three packages (gzip tar, bz2 tar and zip) and a file with SHA1 checksums for these packages. CAUTION: This target needs a doxygen project file and the doxygen program installed!
- release-clean - Removes the previously created source release files (see above).
How to use
The incron daemon (incrond) must be run under root (typically from runlevel script etc.). It loads the current incron tables and hooks them for later changes.
The incron table manipulator may be run under any regular user since it SUIDs. For manipulation with the tables use basically the same syntax as for the crontab program. You can import a table, remove and edit the current table.
The user table rows have the following syntax (use one or more spaces between elements):
<path> <mask> <command>
Where:
<path>
is a filesystem path (each whitespace must be prepended by a backslash)<mask>
is a symbolic (seeinotify.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)
The mask may additionaly contain a special symbol IN_NO_LOOP
which disables
events occurred during processing the event (to avoid loops).
Example: You need to run program 'abc'
with the full file path as
an argument every time a file is changed in /var/mail
. One of
the solutions follows:
/var/mail IN_CLOSE_WRITE abc $@/$#
Since 0.4.0 also system tables are supported. They are located in
/etc/incron.d
and their commands use root privileges. System tables
are intended to be changed directly (without incrontab).
For detailed information about use of incrond and incrontab, please see their man pages (included in incron packages).
Licensing
This program is free software; you can use it, redistribute it and/or modify it under the terms of the GNU General Public License, version 2.
Internal reference documentation (latest version)
There is no real need why to download the reference documentation from here. Each incron source package contains the appropriate version of the reference documentation.
Bugs, suggestions
THIS PROGRAM IS AN ALPHA VERSION. IT PROBABLY CONTAINS BUGS AND THEREFORE IT IS NOT INTENDED FOR PRODUCTION USE.
If you find a bug or have a suggestion how to improve the program, please use the bug tracking system.