summaryrefslogtreecommitdiff
path: root/ypxfr/ypxfr.8.xml
blob: 8ef3de4c3d16adb80d8bc301a9287ee35dcbb14f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
                   "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">

<refentry id='ypxfr'>

  <refmeta>
    <refentrytitle>ypxfr</refentrytitle>
    <manvolnum>8</manvolnum>
    <refmiscinfo class='setdesc'>NIS Reference Manual</refmiscinfo>
  </refmeta>

  <refnamediv id='name'>
    <refname>ypxfr</refname>
    <refpurpose>transfer NIS database from remote server to local host</refpurpose>
  </refnamediv>

<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
  <command>/usr/lib/yp/ypxfr</command>
    <arg choice='opt'>-f</arg>
    <arg choice='opt'>-c</arg>
    <arg choice='opt'>-d <replaceable>target</replaceable> <replaceable>domain</replaceable></arg>
    <arg choice='opt'>-h <replaceable>source</replaceable> <replaceable>host</replaceable></arg>
    <arg choice='opt'>-s <replaceable>source</replaceable> <replaceable>domain</replaceable></arg>
    <arg choice='opt'>-C <replaceable>taskid</replaceable> <replaceable>program-number</replaceable> <replaceable>host</replaceable> <replaceable>port</replaceable></arg>
    <arg choice='opt'>-p <replaceable>yp_path</replaceable></arg>
    <arg choice='plain' rep='repeat'><replaceable>mapname</replaceable></arg>

    <sbr/>
</cmdsynopsis>
</refsynopsisdiv>


<refsect1 id='description'><title>DESCRIPTION</title>
<para><emphasis remap='B'>ypxfr</emphasis>
copies an NIS database from one NIS server to the local host by
using the NIS service.
<emphasis remap='B'>ypxfr</emphasis>
is generally invoked by
<emphasis remap='B'>ypinit</emphasis>
or by
<emphasis remap='B'>ypserv,</emphasis>
when
<emphasis remap='B'>ypserv</emphasis>
receives a map transfer request from
<emphasis remap='B'>yppush.</emphasis>
It creates a temporary map in the directory
<filename>/var/yp/domain</filename>
(this  directory  must already  exist;
<emphasis remap='I'>domain</emphasis>
is the default domainname for the local host), fills it by getting
the map's entries and fetches the map parameters (master and order number).
If the transfer was successful, the old version of the map will be
deleted and the temporary copy will be moved into its place.
Then,
<emphasis remap='B'>ypxfr</emphasis>
will attempt to send a "clear current map" request to the local
<emphasis remap='B'>ypserv.</emphasis></para>

<para>If  run interactively,
<emphasis remap='B'>ypxfr</emphasis>
writes its output to stderr.
However, if it is invoked without a controlling terminal, it will
log the output to syslog.</para>

<para><emphasis remap='B'>ypxfr</emphasis>
is used primarily in environments where several NIS servers are in use.
For all maps, you have a NIS master server, which  maintains a canonical
copy of the NIS map, and all the other servers, the NIS slaves, copy
the new version of the map from the master whenever a update was made.
Normally, you have one NIS master for all maps.</para>

<para>In order to maintain consistency across all NIS servers,
<emphasis remap='B'>ypxfr</emphasis>
can be run periodically in a
<emphasis remap='B'>cron</emphasis>
job. Maps which change infrequently need only be updated once a day
(preferably late at night when system usage is lowest), where those
with frequent changes (such as
<emphasis remap='I'>passwd.byname</emphasis>
and
<emphasis remap='I'>passwd.byuid )</emphasis>
should be updated perhaps once every hour.
Examples are in
<filename>/usr/lib/yp: ypxfr_1perday, ypxfr_2perday,</filename>
and
<emphasis remap='B'>ypxfr_1perhour.</emphasis>
They can serve as reasonable first cuts.</para>

<para>Normally all updates should be propagated by
<emphasis remap='B'>yppush</emphasis>
when
<filename>/var/yp/Makefile</filename>
is run on the NIS master server, however it is a good practice
on large networks where possible outages could cause NIS slaves to
fall out of sync with the master.</para>


</refsect1>

<refsect1 id='options'><title>OPTIONS</title>
<para>The following options are supported:</para>
<variablelist remap='TP'>
  <varlistentry>
  <term><option>-f</option></term>
  <listitem>
<para>Force a map transfer. Normally,
<emphasis remap='B'>ypxfr</emphasis>
will not transfer a map if it determines that the NIS master's copy
is not newer than the existing copy already on the local host. This
flag forces a transfer regardless of which server's version is more
recent.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><option>-c</option></term>
  <listitem>
<para>Do not send a "clear current map" request to the
<emphasis remap='B'>ypserv</emphasis>
process running on the local host. This flag is normally used when
invoking
<emphasis remap='B'>ypxfr</emphasis>
by
<emphasis remap='B'>ypinit</emphasis>
or if
<emphasis remap='B'>ypserv</emphasis>
is not  running  locally  at  the time you are running
<emphasis remap='B'>ypxfr.</emphasis>
Otherwise,
<emphasis remap='B'>ypxfr</emphasis>
will complain that it cannot talk to the local
<emphasis remap='B'>ypserv,</emphasis>
and the transfer will fail.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><option>-d</option><replaceable> domain</replaceable></term>
  <listitem>
<para>Specify a domain other than the default NIS domain.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><option>-h</option><replaceable> source host</replaceable></term>
  <listitem>
<para>Get the map from
<emphasis remap='I'>host</emphasis>,
regardless of what the map says the master is.  If
<emphasis remap='I'>host</emphasis>
is not specified,
<emphasis remap='B'>ypxfr</emphasis>
asks the
<acronym>NIS</acronym>
service for the name of the master, and tries to get the
map from there. This option is used to insure that ypxfr only copies
maps from the NIS master server.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><option>-s</option><replaceable> source domain</replaceable></term>
  <listitem>
<para>Specify a source domain from which to transfer a map that should be the same
across domains.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><option>-C</option><replaceable> taskid progam-number host port</replaceable></term>
  <listitem>
<para>This option is
<emphasis remap='B'>only</emphasis>
for use by
<emphasis remap='B'>ypserv .</emphasis>
When
<emphasis remap='B'>ypserv</emphasis>
invokes
<emphasis remap='B'>ypxfr</emphasis>,
it specifies that
<emphasis remap='B'>ypxfr</emphasis>
should call back a
<emphasis remap='B'>yppush</emphasis>
process at the host with
<acronym>IP</acronym>
address or name
<emphasis remap='I'>host</emphasis>,
registered as program number
<emphasis remap='I'>progam-number</emphasis>,
listening on port
<emphasis remap='I'>port</emphasis>,
and waiting for a response to transaction
<emphasis remap='I'>taskid</emphasis>.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><option>-p</option><replaceable> yp_path</replaceable></term>
  <listitem>
<para>Change the directory for the maps to
<emphasis remap='I'>yp_path/[domainname]/</emphasis>, the default
is <filename>/var/yp/[domainname]</filename>.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>mapname</emphasis></term>
  <listitem>
<para>One or more names of the map to transfer.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='files'><title>FILES</title>
<para>/var/yp/[domainname]/[maps]</para>
</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para><citerefentry><refentrytitle>ypserv</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>yppush</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>ypinit</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>cron</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>crontab</refentrytitle><manvolnum>5</manvolnum></citerefentry></para>
</refsect1>

<refsect1 id='author'><title>AUTHOR</title>
<para>Thorsten Kukuk &lt;kukuk@linux-nis.org&gt;</para>
</refsect1>
</refentry>