Facron
fanotify cron system
Install / Use
/learn @Keruspe/FacronREADME
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.
Latest release is 1.1
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 many 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 we receive an event matching the fanotify masks on the file path given, the command is launched.
The fanotify masks available are:
FAN_ACCESSFAN_MODIFYFAN_CLOSE_WRITEFAN_CLOSE_NOWRITEFAN_OPENFAN_Q_OVERFLOWFAN_OPEN_PERMFAN_ACCESS_PERMFAN_ONDIRFAN_EVENT_ON_CHILDFAN_CLOSEFAN_ALL_EVENTSFAN_ALL_PERM_EVENTSFAN_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 containis sapces, you can surround it with quotes or double quotes. Four 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$*corresponds to the process id that accessed the file
Three additional arguments are available which handle a global counter:
$+increments the counter and returns its new value$-decrements the counter and returns its new value$=returns its value
You can reload the configuration at any time by sending a SIGUSR1 to facron:
kill -USR1 $(pidof facron)
Related Skills
node-connect
345.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
104.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
