WENDY(1) | General Commands Manual | WENDY(1) |
wendy
— inotify
based event watcher
wendy |
[-acdlrv ] [-m
mask] [-w
inode] [command
[args...]] |
wendy
watches for events in a directory or
its files and executes cmd when an inotify event is
triggered.
-a
-c
-d
-l
-r
-v
-m
mask-w
inode-w
flag multiple
times. If no watcher is added with the -w flag,
wendy
will read path names from
stdin, one per line.The mask is a numeric value passed to inotify to specify the
events that should be raised. Multiple events can be registered by summing
them up, and passing the result to the -m
flag. The
mask can take any of the values below, or a sum of them:
WENDY_INODE
WENDY_EVENT
Whenever an IN_CREATE (256) event is triggered in the Maildir folder INBOX, a sound is played:
wendy -m 256 -w ~/mail/INBOX/new play /usr/share/sound/bell.wav
Use a sub-shell to print event name and path to stdout, showcasing
the variables exported internally (this replicates the
-v
switch):
wendy -m 768 -w . sh -c 'echo $WENDY_EVENT $WENDY_INODE'
Rebuild a project when one of its source files changes:
find . -name '*.[ch]' | wendy make
This example will only watch directory nodes, and will monitor every new directory created, thus propagating event monitoring inside the tree. Note that events happening on files withing these directories will still be reported, making the following command suitable for synchronizing two directories:
find /src -type d | wendy -rd -m 970 rsync -av --delete /src /dest
Willy Goiffon <dev@z3bra.org>
2013-06-02 | POSIX.1-2008 |