updated README

This commit is contained in:
Albert S. 2017-01-07 17:26:30 +01:00
parent db4154a0d1
commit 692e8d4514

59
README
View File

@ -1,49 +1,44 @@
What is adhocify? What is adhocify?
================= =================
adhocify uses inotify to watch for file system events. adhocify uses inotify to watch for file system events. Once an event
Once an event occurs it can execute a script. occurs it can execute a script. The path of the file and the event
The path of the file and the event will be passed to that script. will be passed to that script.
Requirements Requirements
============ ============
adhocify only runs on Linux. You need a kernel and libc with inotify support. 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: Examples:
========= =========
./adhocify -w /tmp/ /home/core/myscript.sh adhocify -w /tmp/ /home/user/myscript.sh
------------------------------------------ Watches for IN_CLOSE_WRITE events in /tmp/ and
Watches for IN_CLOSE_WRITE events in /tmp/, launches script /home/core/myscript.sh launches script /home/user/myscript.sh
/adhocify -w /tmp/ /home/core/myscript.sh {} adhocify -w /tmp/ /home/user/myscript.sh {}
------------------------------------------ Same as above, but also passes the file
Same as above, but also passes the file an event occured on to that script. (argv[1]). an event occured on to that script.(argv[1]).
./adhocify -w /tmp/ /bin/echo the file {} was written to adhocify -w /tmp/ /bin/echo the file {} was written to
--------------------------------------------------------- Running echo "Test" > /tmp/test will print in the shell
Running adhocify was launched in: "the file /tmp/test was written to"
echo "Test" > /tmp/test
Will print in the shell adhocify was launched in: adhocify -w /tmp/ -w /var/run /home/user/myscript.sh
the file /tmp/test was written to Same as above, but also watches /var/run
./adhocify -w /tmp/ -w /var/run /home/core/myscript.sh adhocify /home/user/myscript.sh
------------------------------------------------------ Watches for IN_CLOSE_WRITE events in the current directory, launches script
Same as above, but also watches /var/run /home/user/myscript.
./adhocify /home/core/myscript.sh adhocify -m IN_OPEN -w /tmp /home/user/myscript.sh
--------------------------------- Watches for IN_OPEN events in /tmp/, launches script /home/user/myscript.sh
Watches for IN_CLOSE_WRITE events in the current directory, launches script
/home/core/myscript.
./adhocify -m IN_OPEN -w /tmp /home/core/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
Watches for IN_OPEN events in /tmp/, launches script /home/core/myscript.sh
./adhocify -w /tmp -i *.txt /home/core/myscript.sh
--------------------------------------------------
Watches for IN_CLOSE_WRITE events in /tmp/ but will not pass *.txt files to the script
Further options
===============
-e, --exit-with-child: Instructs adhocify to exit once the script does. You can also specify an exit code, e. g. -e 1, to only exit when the script returns with an error. Default exit code is 0.