DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

ypxfr(NADM)


ypxfr -- transfer an NIS map from an NIS server to here

Syntax

ypxfr [ -b ] [ -S ] [ -f ] [ -h host ] [ -s domain ] [ -d domain ] [ -c ]
[ -C tid prog ipadd port ] mapname

Description

ypxfr moves an NIS map to the local host by making use of normal NIS services. It creates a temporary map in the directory /etc/yp/domain (which must already exist), fills it by enumerating the map's entries, fetches the map parameters (master and order numbers) and loads them. It then deletes any old versions of the map and moves the temporary map to the real mapname.

If ypxfr is run interactively, it writes its output to the terminal. However, if it is invoked without a controlling terminal and the log file /usr/adm/nislog exists, it will append all its output to that file. Since ypxfr is most often run from /usr/lib/crontab, or by ypserv, you can use the log file to retain a record of what was attempted and what the results were.

If the -S secure option is set, ypxfr requires that ypserv on the host be running as root and using a reserved port. If the map being transferred is a secure map, ypxfr sets the permissions on the map to 0600.

For consistency between servers, ypxfr should be run periodically for every map in the NIS database. Different maps change at different rates: for example, the services.byname map may not change for months at a time and may therefore be checked only once a day in the early hours. Conversely, you may know that mail.aliases or hosts.byname may change several times per day. In such a case, you may want to check for updates on an hourly basis. crontab(C) can be used to perform periodic updates automatically. Rather than having a separate crontab entry for each map, you can group commands to update several maps in a shell script. Examples (mnemonically named) are in /etc/yp: ypxfr1pdy, ypxfr2pdy, and ypxfr1phr. They can serve as reasonable first cuts.

Refer to ypfiles(NF) and ypserv(NADM) for an overview of the Network Information Service.

After transferring a map, ypxfr checks for the existence of a file with the same name as the map in the directory /etc/yp/map2ascii. If such a file exists, it is run by forking a shell to execute it. These files must be shell scripts. They are intended to convert the contents of the map with the same name to an ASCII file in the proper place, usually /etc. An example of this is the passwd.nam script. This script is used to convert the contents of the passwd.byname map to a flat ASCII file, which is installed as /etc/passwd. Thus, the utilities on a system may be able to utilize network-wide files such as the passwd or host files without being modified or recompiled to use the NIS versions of the passwd file or host table access routines. See map2ascii(NADM) for more details on this.

Options


-b
preserve the resolver flag in the map during the transfer

-S
only use NIS servers running as root and using a reserved port

-f
force the transfer to occur, even if the version at the master is not more recent than the local version

-c
do not send a ``Clear current map'' request to the local ypserv process. Use this flag if ypserv is not running locally at the time you are running ypxfr. Otherwise, ypxfr will complain that it cannot talk to the local ypserv and the transfer will fail.

-h host
get the map from host, regardless of what the map says the master is. If host is not specified, ypxfr will ask the NIS service for the name of the master and then try to get the map from there. host may be a name or an internet address in the form a.b.c.d.

-s domain
specify a source domain from which to transfer a map that should be the same across domains (such as the services.byname map)

-d domain
specify a domain other than the default domain

-C tid prog ipadd port
This option is only for use by ypserv. When ypserv invokes ypxfr, it specifies that ypxfr should call back a yppush process at the host with IP address ipaddr, registered as program number prog, listening on port port, and waiting for a response to transaction tid.

Files

/usr/adm/nislog,
/etc/yp/ypxfr1pdy,
/etc/yp/ypxfr2pdy,
/etc/yp/ypxfr1phr,
/etc/yp/YP_MAP_X_LATE,
/usr/lib/crontab

See also

map2ascii(NADM), ypfiles(NF), ypmapxlate(NF), yppush(NADM), ypserv(NADM)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005