updating for lsyncd 3

This commit is contained in:
Axel Kittenberger 2018-03-13 15:53:32 +01:00
parent 48a42bd7a1
commit a0b5eaa47c
3 changed files with 29 additions and 64 deletions

View File

@ -13,15 +13,12 @@ For example, the following code will instruct Lsyncd to log into ```/tmp/lsyncd.
{% highlight lua %}
settings {
logfile = "/tmp/lsyncd.log",
statusFile = "/tmp/lsyncd.status",
logfile = '/tmp/lsyncd.log',
statusFile = '/tmp/lsyncd.status',
nodaemon = true,
}
{% endhighlight %}
**Caution**
If you are upgrading from 2.0.x, please notice that `settings` became a function from a variable, so you **MUST** delete the equal sign '=' between `settings` and the `{`.
Valid keys for settings are:
<table>
@ -30,18 +27,6 @@ Valid keys for settings are:
</td><td> =
</td><td> FILENAME
</td><td> logs into this file
</td></tr>
<tr><td> pidfile
</td><td> =
</td><td> FILENAME
</td><td> logs PID into this file
</td></tr>
<tr><td> nodaemon
</td><td> =
</td><td> BOOL
</td><td> does not detach
</td></tr>
<tr><td> statusFile
@ -66,12 +51,6 @@ Valid keys for settings are:
</td><td> =
</td><td> STRING
</td><td> syslog identification (tag), default "lsyncd"
</td></tr>
<tr><td> insist
</td><td> =
</td><td> BOOL
</td><td> keep running at startup although one or more targets failed due to not being reachable.
</td></tr>
<tr><td> inotifyMode

View File

@ -172,14 +172,14 @@ Below is a table of options for the ```rsync``` parameter. Please have a look at
</td><td>
</td></tr>
<tr><td> exclude
<tr><td> filter
</td><td> =
</td><td> PATTERN
</td><td> LIST of RULEs
</td><td>
</td><td>
</td><td> TABLE of PATTERNs also allowed
</td></tr>
<tr><td> excludeFrom
<tr><td> filterFrom
</td><td> =
</td><td> FILENAME
</td><td>
@ -373,13 +373,6 @@ Below is a table of options for the ```rsync``` parameter. Please have a look at
</td><td> BOOL
</td><td> false
</td><td>
</td></tr>
<tr><td> _extra
</td><td> =
</td><td> TABLE of STRINGS.
</td><td>
</td><td> If absolutely needed, additional arguments can be specified as a TABLE of STRINGS(example: <tt>{ "--omit-dir-times", "--omit-link-times" }</tt>). Note that the underscore highlights this as workaround. If you need something that is not covered by the above options, please request it via a feature request on the project website. Most notably, do not add -r for recursive or -a which implies recursive, since Lsyncd will handle that by itself. Additionally do not add -R for relative, which will ruin Lsyncd &lt;-&gt; Rsync communication.
</td></tr>
</table>
@ -441,7 +434,7 @@ sync {
default.rsyncssh,
source="/srcdir",
host="remotehost",
excludeFrom="/etc/lsyncd.exclude",
filterFrom="/etc/lsyncd.filter",
targetdir="/dstdir",
rsync = {
archive = true,
@ -515,13 +508,13 @@ Two additional parameters can be specified to sync{}:
<table>
<tr><td> excludeFrom
<tr><td> filterFrom
</td><td> =
</td><td> FILENAME
</td><td> loads exclusion rules from this file, on rule per line
</td></tr>
<tr><td> exclude
<tr><td> filter
</td><td> =
</td><td> LIST
</td><td> loads exclusion rules from this list of strings

View File

@ -17,13 +17,13 @@ Also like most Unix tools, ```--version``` or ```-version``` will let Lsyncd pri
lsyncd -version
{% endhighlight %}
Lsyncd 2.1 is configured through a config file.
Lsyncd 3 is configured through at least one config file.
{% highlight shell %}
lsyncd CONFIGFILE
{% endhighlight %}
A disadvantage with Rsync synchronization is that normally directory and file moves result in a deletion of the move origin and a retransfer of the move destination of the wire. However, Lsyncd 2 can use ssh commands to move the directories and files locally on the target. To use this use ```-rsyncssh``` followed by the local source directory, the remote host and the target directory there. The REMOTEHOST can include a user like ```me@remotehost.com```.
A disadvantage with Rsync synchronization is that normally directory and file moves result in a deletion of the move origin and a retransfer of the move destination of the wire. However, Lsyncd 3 can use ssh commands to move the directories and files locally on the target. To use this use ```-rsyncssh``` followed by the local source directory, the remote host and the target directory there. The REMOTEHOST can include a user like ```me@remotehost.com```.
There is a difference in behaviour when running with -nodaemon. Lsyncd will not change its working directory to ```/```, as it does when becoming a daemon. Thus relative targets like ```./target``` will work with ```-nodaemon``` but must be specified to absolute paths to work in daemon mode. The source directories will also be turned into absolute paths by Lsyncd. The reason targets are not resolved to absolute paths while sources are is because Lsyncd itself does not care about the format of the target specifier which can also be remote hosts, rsyncd modules, etc. It is opaquely handed to rsync. It cares about the observed directories though.
@ -39,10 +39,3 @@ This might easily become too much. A particularly useful category is "Exec" whic
lsyncd -log Exec CONFIGFILE
{% endhighlight %}
When the initial startup sync fails by default Lsyncd will terminate with an error message. It has been designed this way, so configuration failures are visibly reported to a possibly beginning user. However, in production a remote target might be done, but you want Lsyncd to start nevertheless and keep trying to sync to the remote target until it is up.
{% highlight shell %}
lsyncd -insist -rsync /home/USER/src remotehost:dst
{% endhighlight %}
In production mode it is recommended to have insist on. It can also be specified in the settings{} command in a config file.