Inotify-driven rsync (Re: Will rsync support btrfs file system?)

Matt McCutchen matt at
Mon Dec 7 08:30:12 MST 2009

On Sun, 2009-12-06 at 15:30 -0500, Benjamin R. Haskell wrote:
> Huh.  Cool.  This might not be all that difficult.  I downloaded 
> inotify-tools from and the following test (monitor 
> all changes to my home directory) seems to be producing interesting 
> results:
> find /home/ -xdev -type d | sudo inotifywait --fromfile - -m | perl -lnwe 'BEGIN{$|=1;} print unless $h{$_}; $h{$_}++'
> I had to `echo 100000 | sudo tee /proc/sys/fs/inotify/max_user_watches` to 
> increase the paltry 8192 default, but nonetheless I see how this could be 
> usefully turned into a nice monitoring system.  (The above test doesn't 
> update the list of directories being watched, for example, so 
> newly-created directories aren't added.)

This has been discussed before.  I wrote a pretty sloppy
proof-of-concept script to call rsync on files reported by inotifywait:

Darryl Dixon said he had a more complete solution based on pyinotify:


More information about the rsync mailing list