Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to configure the interval of lsyncd monitoring files changes?

as you know, lsyncd can watching local file changes and trigger rsync to sync files chanages to remote server. my question is how to configure the interval of lsyncd monitoring files changes?
I have not found any paramters in lsyncd.conf, any clue will be appreciated.

thanks,
Emre

like image 546
Emre He Avatar asked Jul 16 '14 14:07

Emre He


People also ask

How often does Lsyncd run?

Lsyncd Configuration To retain this sync process instead of running a cron job every X minutes, lsyncd uses linux kernel hooks to get notifications when any file within a directory has been changed. By default, it queues up any sync commands in 20 seconds.

How does lsyncd work?

Lsyncd uses a filesystem event interface (inotify or fsevents) to watch for changes to local files and directories. Lsyncd collates these events for several seconds and then spawns one or more processes to synchronize the changes to a remote filesystem. The default synchronization method is rsync.

Is Lsyncd bidirectional?

Please remember that lsyncd is not primarily designed for a 2-way sync and this is as close as it can get to being one.

What is Lsyncd in Linux?

Lsyncd stands for Live Syncing Mirror Daemon, and it is a tool used in Linux systems to keep directories synchronized. These directories can be found locally, within the same machine, or remotely, on different machines. For remote synchronization, this article focuses on using SSH to accomplish it.


1 Answers

I think it's not possible to configure the interval that lsyncd monitors file changes as lsyncd rather is event based, so the local directory tree is monitored through the event monitor interface (inotify or fsevents) which means in a sense it is always watching.

What you can influence is the time lsyncd aggregates changes before it spawns a rsync call (by default this is 15 seconds) by providing the delay parameter.

sync{default.rsync, source="dir", target="dir", delay=25}

Setting it to 0 will cause it to sync as early as possible.

like image 57
bfloriang Avatar answered Nov 15 '22 04:11

bfloriang