adhocify/README

45 line
1.3 KiB
Plaintext

2013-08-29 14:42:03 +02:00
What is adhocify?
=================
2017-01-07 17:26:30 +01:00
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.
2013-08-29 14:42:03 +02:00
2014-10-22 00:30:53 +02:00
Requirements
============
2017-01-07 17:26:30 +01:00
adhocify only runs on Linux. You need a kernel and libc with inotify
support - pretty much all satisfy this condition.
Options
=======
See adhocify --help.
2013-08-29 14:42:03 +02:00
Examples:
2016-01-02 14:23:43 +01:00
=========
2017-01-07 17:26:30 +01:00
adhocify -w /tmp/ /home/user/myscript.sh
Watches for IN_CLOSE_WRITE events in /tmp/ and
launches script /home/user/myscript.sh
2013-08-29 14:42:03 +02:00
2017-01-07 17:26:30 +01:00
adhocify -w /tmp/ /home/user/myscript.sh {}
Same as above, but also passes the file
an event occured on to that script.(argv[1]).
2014-10-22 00:30:53 +02:00
2017-01-07 17:26:30 +01:00
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"
2014-10-22 00:30:53 +02:00
2017-01-07 17:26:30 +01:00
adhocify -w /tmp/ -w /var/run /home/user/myscript.sh
Same as above, but also watches /var/run
2014-10-22 00:30:53 +02:00
2017-01-07 17:26:30 +01:00
adhocify /home/user/myscript.sh
Watches for IN_CLOSE_WRITE events in the current directory, launches script
/home/user/myscript.
2013-08-29 14:42:03 +02:00
2017-01-07 17:26:30 +01:00
adhocify -m IN_OPEN -w /tmp /home/user/myscript.sh
Watches for IN_OPEN events in /tmp/, launches script /home/user/myscript.sh
2013-08-29 14:42:03 +02:00
2017-01-07 17:26:30 +01:00
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
2013-08-29 14:42:03 +02:00