executes commands upon file system events (using inotify)
Go to file
Albert S bd9bcd8752 Remove -r: It's existence cannot be justified
We already have -s to read from stdin, there is no point to
walk paths ourselves.

find . -type d | adhocify -s [path to script] is pretty much the same.
2017-07-27 22:10:49 +02:00
examples added encryptor.sh example 2016-02-06 18:33:33 +01:00
adhocify.c Remove -r: It's existence cannot be justified 2017-07-27 22:10:49 +02:00
Makefile replace gcc with in makefile 2014-03-05 18:18:56 +01:00
README updated README 2017-01-07 17:26:30 +01:00
README.md updated README.md formating 2017-03-19 10:49:58 +01:00
TODO updated TODO 2017-03-31 13:33:06 +02:00

What is adhocify?

adhocify uses inotify to watch for file system events. Once an event occurs it can execute a script. The path of the file and the event will be passed to that script.

Requirements

adhocify only runs on Linux. You need a kernel and libc with inotify support - pretty much all satisfy this condition.

Options

See adhocify --help.

Examples:

adhocify -w /tmp/ /home/user/myscript.sh

  • Watches for IN_CLOSE_WRITE events in /tmp/ and launches script /home/user/myscript.sh

adhocify -w /tmp/ /home/user/myscript.sh {}

  • Same as above, but also passes the file an event occured on to that script.(argv[1]).

adhocify -w /tmp/ /bin/echo the file {} was written to

  • Running echo "Test" > /tmp/test will print in the shell adhocify was launched in: "the file /tmp/test was written to"

adhocify -w /tmp/ -w /var/run /home/user/myscript.sh

  • Same as above, but also watches /var/run

adhocify /home/user/myscript.sh

  • Watches for IN_CLOSE_WRITE events in the current directory, launches script /home/user/myscript.

adhocify -m IN_OPEN -w /tmp /home/user/myscript.sh

  • Watches for IN_OPEN events in /tmp/, launches script /home/user/myscript.sh

adhocify -w /tmp -i *.txt /home/user/myscript.sh

  • Watches for IN_CLOSE_WRITE events in /tmp/ but will not pass *.txt files to the script