Etienne D
2008-Nov-19 15:48 UTC
Configuring Rsync to run without any user input or Cron job.
Hi ! I would like to know if it's possible for Rsync to automatically mirror a folder and it's content from one deamon to another. (or one client to a deamon) Basically I want users to drag and drop files in a folder and Rsync to mirror these files as soon as it sees them. A cron or schedule task is not a viable solution since we can receive files any time of night or day and we need to send them in very timely manner. I was looking into Rsync list of parameters, but couldn't find that precise option... We were using Double-Take in the past, but it's only giving us troubles. Thanks in advance for the tip. -- View this message in context: http://www.nabble.com/Configuring-Rsync-to-run-without-any-user-input-or-Cron-job.-tp20581708p20581708.html Sent from the Samba - rsync mailing list archive at Nabble.com.
Kyle Lanclos
2008-Nov-19 17:11 UTC
Configuring Rsync to run without any user input or Cron job.
Etienne wrote:> I would like to know if it's possible for Rsync to automatically mirror a > folder and it's content from one deamon to another. (or one client to a > deamon) Basically I want users to drag and drop files in a folder and Rsync > to mirror these files as soon as it sees them. A cron or schedule task is > not a viable solution since we can receive files any time of night or day > and we need to send them in very timely manner.How timely is timely? I have an rsync wrapper script that is invoked by cron every sixty seconds. If rsync is running (which implies that a file is being transferred), it aborts, otherwise, it does its normal rsync thing. The end-result is that we start transferring files from one location to another about 30 seconds (on average) after the file is written. It works quite well for our purposes, but in our case, "timely" is generally less than five minutes. --Kyle
Matthias Schniedermeyer
2008-Nov-19 20:49 UTC
Configuring Rsync to run without any user input or Cron job.
On 19.11.2008 07:03, Etienne D wrote:> > Hi ! > > I would like to know if it's possible for Rsync to automatically mirror a > folder and it's content from one deamon to another. (or one client to a > deamon) Basically I want users to drag and drop files in a folder and Rsync > to mirror these files as soon as it sees them. A cron or schedule task is > not a viable solution since we can receive files any time of night or day > and we need to send them in very timely manner. I was looking into Rsync > list of parameters, but couldn't find that precise option... We were using > Double-Take in the past, but it's only giving us troubles. Thanks in advance > for the tip.For "as soon as it happens" i would suggest you build yourself something around inotify. Which is availe for Linux Kernel 2.6.10 and newer. The "IN_CLOSE_WRITE" is likely the event you are looking for. Bis denn -- Real Programmers consider "what you see is what you get" to be just as bad a concept in Text Editors as it is in women. No, the Real Programmer wants a "you asked for it, you got it" text editor -- complicated, cryptic, powerful, unforgiving, dangerous.
Michal Soltys
2008-Nov-19 21:52 UTC
Configuring Rsync to run without any user input or Cron job.
Etienne D wrote:> Hi ! > > I would like to know if it's possible for Rsync to automatically mirror a > folder and it's content from one deamon to another. (or one client to a > deamon) Basically I want users to drag and drop files in a folder and Rsync > to mirror these files as soon as it sees them. A cron or schedule task is > not a viable solution since we can receive files any time of night or day > and we need to send them in very timely manner. I was looking into Rsync > list of parameters, but couldn't find that precise option... We were using > Double-Take in the past, but it's only giving us troubles. Thanks in advance > for the tip.Additionally to what Matthias wrote in another reply about inotify - you could experiment with http://search.cpan.org/~mlehmann/Linux-Inotify2-1.2/ if you're somewhat used to perl.
Henri S
2008-Nov-20 23:50 UTC
Configuring Rsync to run without any user input or Cron job.
I am unsure of your operating system requirments. However, Mac OS X 10.4 and later supports LaunchD and watch folders. This lets you run a script when items at a specific path change. A second hand machine which runs Mac OS X 10.4 should not set you back that much.