|
|
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.