# rsync on change



## Leander (Sep 7, 2014)

Hi,

I wonder if there is a way to set up rsync to synchronize files on change only. Meaning if a file changes it will be synchronized immediately? I've heard of something like "inotifywait" on the Linux site. Now I wonder if there is a solution for our loved FreeBSD?


----------



## junovitch@ (Sep 7, 2014)

*Re: rsynd on change*

I remember seeing this page a while back that does basically what you are talking about.  I never tried it but it seemed interesting nonetheless and I was able to find it after a quick search.  Take a look: http://blog.elitecoderz.net/tag/rsync/.  I don't thing there is an "inotifywait" equivalent so the author here set up auditd() to feed in file related audit events into a program that will rsync those changes elsewhere.  This was a couple years ago though.  With all the work on distributed file systems on stuff like GlusterFS, databases/leofs, and potentially others that haven't hit the ports tree yet there likely is or will be more robust ways to do accomplish this goal.


----------

