Like inotify-tools but for OS X's FSEvents
C Shell M4 Makefile Perl
Latest commit 8e5fd1e Apr 1, 2016 @ggreer Merge pull request #17 from Klortho/rsync-opts
Add ability to set rsync options with an environment variable

FSEvents Tools

Build Status

Floobits Status


Command-line tools and scripts that use OS X's FSEvents API. Mostly useful for watching a directory and reacting to changes in it.

This post explains why I made this and includes more usage examples.

Usage examples

Alert if any files in a directory are changed.

notifywait /path/; echo "\007"

Rebuild LESS when anything in styles changes. Assuming you have a script similar to this

for less_file in styles/*.less
  css_file=`echo $less_file | sed -E "s/.less//"`
  lessc $less_file $css_file.css

...just run:

notifyloop styles ./

Automatically rsync files to a remote server if any of them are changed.

autorsync .

The above invokes rsync with -avz (archive mode, verbose, compress). To pass additional arguments to rsync, for example:

RSYNC_OPTS='--exclude="*.pyc"' autorsync .

To do the same thing "manually":

notifyloop . rsync -avz --exclude="*.pyc" .

Building from source

Building master

In addition to the standard automake/autoconf/make, you'll need pkg-config. brew install pkg-config should do the trick.

Once you have all the dependencies, run ./ and make install.

Building a release tarball

GPG-signed releases are available here.

Building release tarballs requires the same dependencies, except for automake and pkg-config. Once you've installed the dependencies, run:

make install

Depending on permissions, make install may require sudo.

Related software

  • inotify-tools. The original tools that inspired me to make fsevents-tools.
  • Lsyncd. A service to keep files synced between a master and one or more slave servers.