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
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With