Subversion Repositories public

Rev

Rev 69 | Rev 73 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
71 luk 1
.TH "incrontab" "5" "0.5.1" "Lukas Jelinek" "incron documentation"
57 luk 2
.SH "NAME"
3
incrontab \- tables for driving inotify cron (incron)
4
.SH "DESCRIPTION"
67 luk 5
An incrontab file contains instructions to the \fIincrond\fR(8) daemon of the general form: "run this command on these file events". There are two categories of tables: system tables (with root privileges) and user tables (with user privileges).
57 luk 6
 
69 luk 7
System tables are (by default) located in /etc/incron.d and may have any names. Each system table exists separately inside incron and their watches never collide.
67 luk 8
 
9
Each user has their own table, and commands in any given incrontab will be executed as the user who owns the incrontab. System users (such as apache, postfix, nobody etc.) may have their own incrontab.
10
 
57 luk 11
incrontab files are read when the \fIincrond\fR(8) daemon starts and after any change (incrontab file are being hooked when incrond is running).
12
 
13
Blank lines are ignored. The general line format is the following:
14
 
15
<path> <mask> <command>
16
 
17
Where \fIpath\fR is an absolute filesystem path, \fImask\fR is an event mask (in symbolic or numeric form) and \fIcommand\fR is an executable file (or a script) with its arguments. The executable file may be noted as an absolute path or only as the name itself (PATH locations are examined).
18
 
67 luk 19
Please remember that the same path may occur only once per table (otherwise only the first occurrence takes effect and an error message is emitted to the system log).
57 luk 20
.SH "EXAMPLE"
21
These are some example rules which can be used in an incrontab file:
22
 
23
/tmp IN_ALL_EVENTS abcd $@/$# $%
24
 
25
/usr/bin IN_ACCESS,IN_NO_LOOP abcd $#
26
 
27
/home IN_CREATE /usr/local/bin/abcd $#
28
 
29
/var/log 12 abcd $@/$#
30
 
31
The first line monitors all events on the /tmp directory. When an event occurs it runs a application called 'abcd' with the full path of the file as the first arguments and the event flags as the second one.
32
 
33
The second line monitors accesses (readings) on the /usr/bin directory. The application 'abcd' is run as a handler and the appropriate event watch is disabled until the program finishes. The file name (without the directory path) is passed in as an argument.
34
 
35
The third example is used for monitoring the /home directory for newly create files or directories (it practically means an event is sent when a new user is added). This event is processed by a program specified by an absolute path.
36
 
37
And the final line shows how to use numeric event mask instead of textual one. The value 12 is exactly the same as IN_ATTRIB,IN_CLOSE_WRITE.
67 luk 38
 
57 luk 39
.SH "SEE ALSO"
40
incrond(8), incrontab(1)
41
.SH "AUTHOR"
42
Lukas Jelinek <lukas@aiken.cz>
43
.SH "COPYING"
44
This program is free software. It can be used, redistributed and/or modified under the terms of the GNU General Public License, version 2.