---
layout: default
title: "The Configuration File"
short: "Config File"
---
Lsyncd configuration files are valid [Lua syntax](http://www.lua.org/). It is designed to be simple yet potent. While rich configuration and simplicity are not opposites by themselves, some trade-offs are inevitable. To achieve both goals as far as possible, Lsyncd configuration can be done at different layers. Lower layers add adaptability while the interface becomes more engaging.
Settings
--------
For scripts of all layers, the ```settings``` call can be used to alter daemon-wide configurations.
For example, the following code will instruct Lsyncd to log into ```/tmp/lsyncd.log```, periodically update the file ```/tmp/lsyncd.status``` with its status and to not detach as a daemon.
{% highlight lua %}
settings {
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:
logfile
| =
| FILENAME
| logs into this file
|
pidfile
| =
| FILENAME
| logs PID into this file
|
nodaemon
| =
| true
| does not detach
|
statusFile
| =
| FILENAME
| periodically writes a status report to this file
|
statusInterval
| =
| NUMBER
| writes the status file at shortest after this number of seconds has passed (default: 10)
|
logfacility
| =
| STRING
| syslog facility, default "user"
|
logident
| =
| STRING
| syslog identification (tag), default "lsyncd"
|
insisit
| =
| true
| keep running at startup altough one or more targets failed due to not being reachable.
|
inotifyMode
| =
| STRING
| Specifies on inotify systems what kind of changes to listen to. Can be "Modify", "CloseWrite" (default) or "CloseWrite or Modify".
|
maxProcesses
| =
| NUMBER
| Lysncd will not spawn more than these number of processes. This adds across all sync{}s.
|
Additionally some parameters can be configured, which are inherited by all _Syncs_ (see Layer 3)
maxDelays
| =
| NUMBER
| When this amount of delayed events is queued, actions will be spawned, even below the delay timer.
|