incrond(8)

πŸ“¦
version 0.5.12 Β· 2 versions
, in alpine 3.24, arch rolling, epel 10, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– incrond(8) β€” the inotify cron daemon, explained by your fav ✨

okay so bestie, welcome to incrond(8), the manual page for the inotify cron daemon. yes it's section 8, yes it's a daemon, no it's not scary, i promise 🫢


🌸 NAME 🌸

incrond β€” inotify cron (incron) daemon. that's it, that's the whole name. short, iconic, does exactly what it says πŸ’…


✨ SYNOPSIS ✨

incrond [ -f file ] [ -n | -k ]

look at her. three little things max and she's running your whole filesystem-watching empire πŸ‘‘


πŸŽ€ DESCRIPTION πŸŽ€

so the inotify cron daemon (incrond) is a daemon that watches filesystem events and executes commands defined in system and user tables. its whole vibe is "generally similar to cron(8)" β€” like cron's cooler cousin who actually notices things happening πŸ¦‹

incrond can be started from /etc/rc, /etc/rc.local and so on. it daemonizes itself, which means it returns immediately β€” so no, you do not need to start it with & and you do not need nohup(1). not me watching people add & for no reason 😭. it can be run on foreground too if that's your thing.

incrond uses two categories of tables β€” incrontab(5), go read it, i'll wait πŸ’–

  • System tables are usually located in /etc/incron.d and are maintained outside of incron (e.g. by various applications). these tables work on root rights level, so literally any file may be watched and commands are executed with root privileges. highkey powerful, so be careful who you give this to πŸ‘€
  • User tables are located in /var/spool/incron by default and have names based on user accounts. these tables use the users' access rights, so only files which the user may access are watched. commands are executed with the users' privileges. much more chill, much more safe 🌈

if a table (incrontab) is changed, incrond reacts immediately and reloads the table. currently running child processes (commands) are not affected β€” they just keep doing their thing, living their truth ✨

there are two files determining whether an user is allowed to use incron. these files have very simple syntax β€” one user name per line, that's it, no notes:

  • if /etc/incron.allow exists, the user must be noted there to be allowed to use incron.
  • otherwise if /etc/incron.deny exists, the user must not be noted there to use incron.
  • if none of these files exists, there is no other restriction whether anybody may use incron.

the location of these files can be changed in the configuration. slay, configurable πŸ’…

⚠️ okay so this next part is the serious one, bestie. the daemon itself is currently not protected against looping. if a command executed due to an event causes the same event, it leads to an infinite loop unless a flag mask containing loopable=true is specified. please beware of this and do not allow permission for use incron to unreliable users. fr fr, this is the "i'm not mad, i'm just disappointed" part of the page πŸ’€

then the options, but like, also described inline here:

the -n (or --foreground) option causes running on foreground. useful especially for testing, debugging and optimization. main character debugging energy πŸ”₯

the -k (or --kill) option terminates a running instance of incrond. bye bestie πŸ‘‹

the -f <FILE> (or --config=<FILE>) option specifies another location for the configuration file (/etc/incron.conf is used by default).

Environment variables: for system tables, the default (the same as for incrond itself) environment variable set is used. the same applies to root's table. for non-root user tables, the whole environment is cleared and then only these variables are set: LOGNAME, USER, USERNAME, SHELL, HOME and PATH. the variables (except PATH) take values from the user database (e.g. /etc/passwd). the PATH variable is set to:

/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin

clean slate, no inherited chaos, we love a fresh start 🌸


πŸ¦‹ SEE ALSO πŸ¦‹

go read them, they're the supporting cast and they ate πŸ‘‘


πŸ’€ BUGS πŸ’€

incrond is currently not resistent against looping. yes, again. it's in BUGS and in DESCRIPTION. the manpage is nothing if not consistent πŸ™ˆ


🧚 AUTHOR 🧚

  • Andreas Altair Redmer <altair.ibn.la.ahad.sy@gmail.com> β€” please report bugs to https://github.com/ar-/incron/issues (this part is literally in the original, i'm not making it up, go report the bugs 🫢)
  • Lukas Jelinek <lukas@aiken.cz>

πŸ’œ COPYING πŸ’œ

This program is free software. It can be used, redistributed and/or modified under the terms of the GNU General Public License, version 2. iconic, legally protected, free πŸ’–


and that's the whole page!! 🌈 written by Lukas Jelinek, version 0.5.12, dated alongside it in the incrond(8) footer β€” mwah, no cap, she's an icon, periodt πŸ’…βœ¨πŸŽ€