HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

lsyncd — Watch files and directories and run `rsync` when they change. It is often used to keep two directori

Submitted by: @import:tldr-pages··
0
Viewed 0 times
lsyncdcommandfilesanddirectoriescliwatch

Problem

How to use the lsyncd command: Watch files and directories and run rsync when they change. It is often used to keep two directories on separate systems in sync, ensuring that changes made in one directory are immediately mirrored to the other. More information: <https://github.com/lsyncd/lsyncd/blob/master/docs/manpage/lsyncd.1.txt>.

Solution

lsyncd — Watch files and directories and run rsync when they change. It is often used to keep two directories on separate systems in sync, ensuring that changes made in one directory are immediately mirrored to the other. More information: <https://github.com/lsyncd/lsyncd/blob/master/docs/manpage/lsyncd.1.txt>.

Watch the source for changes and run rsync to synchronize files to the destination on every change:
lsyncd -rsync {{path/to/source}} {{host::share_name}}


Use SSH instead of rsyncd shares:
lsyncd -rsyncssh {{path/to/source}} {{host}} {{path/to/destination}}

Code Snippets

Watch the source for changes and run `rsync` to synchronize files to the destination on every change

lsyncd -rsync {{path/to/source}} {{host::share_name}}

Use SSH instead of `rsyncd` shares

lsyncd -rsyncssh {{path/to/source}} {{host}} {{path/to/destination}}

Context

tldr-pages: common/lsyncd

Revisions (0)

No revisions yet.