forked from Keruspe/facron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
57 lines (42 loc) · 1.61 KB
/
README
File metadata and controls
57 lines (42 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
facron is a new generation filesystem cron
See http://www.imagination-land.org/posts/2012-12-04-facron-fanotify-cron-system.html and
http://www.imagination-land.org/posts/2012-12-07-facron-released.html for more details.
To build facron:
git clone git://github.com/Keruspe/facron.git
cd facron
./autogen.sh
./configure --sysconfdir=/etc --with-systemdsystemunitdir=/usr/lib/systemd/system
make
sudo make install
facron configuration file is "/etc/facron.conf".
You can put as much entries as you want in this file, one entry per line.
Each line must be formatted like this:
<file path> <fanotify masks> <command>
Each time an event matching the fanotify masks i sent regarding the file path given
the command is launched
The fanotify masks available are:
FAN_ACCESS
FAN_MODIFY
FAN_CLOSE_WRITE
FAN_CLOSE_NOWRITE
FAN_OPEN
FAN_Q_OVERFLOW
FAN_OPEN_PERM
FAN_ACCESS_PERM
FAN_ONDIR
FAN_EVENT_ON_CHILD
FAN_CLOSE
FAN_ALL_EVENTS
FAN_ALL_PERM_EVENTS
FAN_ALL_OUTGOING_EVENTS
If you configure your fanotify masks like this:
FAN_MODIFY|FAN_CLOSE_WRITE,FAN_OPEN
The event caught will be: either FAN_MODIFY AND FAN_CLOSE_WRITE, or FAN_OPEN
The command should be an absolute path. You can pass it arguments.
If any of your arguments contain sapces, you can surrond it with quotes or double quotes.
Three special arguments are available:
$@ corresponds to the dirname of your file
$# corresponds to the basename of your file
$$ corresponds to the full path of your file
You can reload the configuration at any time by sending a SIGUSR1 to facron:
kill -USR1 $(pidof facron)