YPXFR(8)

NAME
ypxfr - transfer a YP map from some YP server to here

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

DESCRIPTION
Ypxfr moves a YP map to the local host by making use of normal YP 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 number) 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's invoked without a controlling terminal and the log file /etc/yp/ypxfr.log exists, it appends all of 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 the results.

For consistency between servers, ypxfr should be run periodically for every map in the YP data base. Different maps change at different rates. For example, the services.byname map might not change for months at a time, and therefore might need checking only once a day in the wee hours. However, hosts.byname could change several times per day. In such a case, you might want to check hourly for updates. A crontab(5) entry 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: ypxfr_1perday.sh, ypxfr_2perday.sh, and ypxfr_1perhour.sh . They can serve as reasonable first cuts.

Refer to ypfiles(5) and ypserv(8) for an overview of the yellow pages.

OPTIONS

Force the transfer to occur even if the version at the master is not
    more recent than the local version.

Don't 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 complains that it can't talk to the local ypserv, and the transfer fails.

-h host
    Get the map from host, regardless of what the map says the master is. If host is not specified, ypxfr asks the YP service for the name of the master, and tries to get the map from there. Host can be a name or an internet address in the form a.b.c.d.

-d domain
    Specify a domain other than the default domain.

-C tid prog ipadd port
    This option is for use by ypserv only. 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
/etc/yp/ypxfr.log
/etc/yp/ypxfr_1perday.sh
/etc/yp/ypxfr_2perday.sh
/etc/yp/ypxfr_1perhour.sh
/usr/lib/crontab

SEE ALSO
ypfiles(5), yppush(8), ypserv(8), YP protocol spec