Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   rsyncd.conf    ( 5 )

файл конфигурации для rsync в режиме демона (configuration file for rsync in daemon mode)

CONFIG DIRECTIVES

There are currently two config directives available that allow a
       config file to incorporate the contents of other files:  &include
       and &merge.  Both allow a reference to either a file or a
       directory.  They differ in how segregated the file's contents are
       considered to be.

The &include directive treats each file as more distinct, with each one inheriting the defaults of the parent file, starting the parameter parsing as globals/defaults, and leaving the defaults unchanged for the parsing of the rest of the parent file.

The &merge directive, on the other hand, treats the file's contents as if it were simply inserted in place of the directive, and thus it can set parameters in a module started in another file, can affect the defaults for other files, etc.

When an &include or &merge directive refers to a directory, it will read in all the *.conf or *.inc files (respectively) that are contained inside that directory (without any recursive scanning), with the files sorted into alpha order. So, if you have a directory named "rsyncd.d" with the files "foo.conf", "bar.conf", and "baz.conf" inside it, this directive:

&include /path/rsyncd.d

would be the same as this set of directives:

&include /path/rsyncd.d/bar.conf &include /path/rsyncd.d/baz.conf &include /path/rsyncd.d/foo.conf

except that it adjusts as files are added and removed from the directory.

The advantage of the &include directive is that you can define one or more modules in a separate file without worrying about unintended side-effects between the self-contained module files.

The advantage of the &merge directive is that you can load config snippets that can be included into multiple module definitions, and you can also set global values that will affect connections (such as motd file), or globals that will affect other include files.

For example, this is a useful /etc/rsyncd.conf file:

port = 873 log file = /var/log/rsync.log pid file = /var/lock/rsync.lock

&merge /etc/rsyncd.d &include /etc/rsyncd.d

This would merge any /etc/rsyncd.d/*.inc files (for global values that should stay in effect), and then include any /etc/rsyncd.d/*.conf files (defining modules without any global- value cross-talk).