adhocify/README

53 baris
1.9 KiB
Plaintext
Mentah Pandangan Normal Riwayat

2013-08-29 14:42:03 +02:00
What is adhocify?
=================
2014-10-22 00:30:53 +02:00
adhocify uses inotify to watch for file system events.
Once an event occurs a script will be launched.
It can pass the path of the file the event occured on to this script.
2013-08-29 14:42:03 +02:00
2014-10-22 00:30:53 +02:00
Requirements
============
adhocify only runs on Linux. You need a kernel and libc with inotify support.
2013-08-29 14:42:03 +02:00
How do I use adhocify?
======================
Launch adhocify without any arguments and you will get the options listed.
Examples:
./adhocify -w /tmp/ /home/core/myscript.sh
------------------------------------------
Watches for IN_CLOSE_WRITE events in /tmp/, launches script /home/core/myscript.sh
2014-10-22 00:30:53 +02:00
/adhocify -w /tmp/ /home/core/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
2013-08-29 14:42:03 +02:00
./adhocify -w /tmp/ -w /var/run /home/core/myscript.sh
------------------------------------------------------
Same as above, but also watches /var/run
./adhocify /home/core/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
----------------------------------------------------
Watches for IN_OPEN events in /tmp/, launches script /home/core/myscript.sh
./adhocify -w /tmp -i *.txt /home/core/myscript.sh
--------------------------------------------------
2015-10-12 22:42:09 +02:00
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
Further options
===============
2015-10-12 22:42:09 +02:00
-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.