[Csync2] How to get Csync to update folders often

Andreas J. Koenig andreas.koenig.gmwojprw at franz.ak.mind.de
Fri Jun 30 09:05:46 CEST 2006


>>>>> On Fri, 30 Jun 2006 14:31:36 +1000, "Michael Mansour" <mic at npgx.com.au> said:

  > Hi Andreas,
 >> >>>>> On Thu, 29 Jun 2006 11:42:26 +0000, Aaron Randall
  > <aaron.randall at visionoss.com> said:
 >> 
 >> > Hi all,
 >> > This will sound like a stupid question, but I've just got csync2
 >> > working with two servers, but I have to use "csync2 -xv" every 
 >> time I  > want to update them.  How can I get them to update the synchronized
 >> > folders ofter (say every time a new file is created, or every few
 >> > minutes or so)??
 >> 
 >> "-x" does a find over the filesystem which is costly, so you do not
 >> want to do it frequently.
 >> 
 >> If you run "-h" on every file and directory creation and deletion,
 >> then you can run "-cu" every minute because it is very fast.

  > How do you do this?

  > Do you cron a "-h" periodically and then a "-cu" ?

No, I have hooks in most programs that write to the disk or remove
from the disk. These hooks call 'csync2 -h somepath' immediately after
writing or deleting. Then I run 'csync2 -cu' every minute. Every 30
minutes I run an additional "csync2 -cr /" so that all file events get
caught that did something on the disk bypassing the hooks.

-- 
andreas


More information about the Csync2 mailing list