Network Information Service (NIS) B.11.31.04 Administrator's Guide
2. From the /usr/newconfig/var/yp directory, copy any one of the sample scripts
ypxfr_1perday, ypxfr_2perday, or ypxfr_1perhour to the /var/yp
directory:
# cp /usr/newconfig/var/yp/ypxfr_1perday /var/yp
# cp /usr/newconfig/var/yp/ypxfr_2perday /var/yp
# cp /usr/newconfig/var/yp/ypxfr_1perhour /var/yp
These scripts contain commands to transfer a set of maps from the NIS master to
the slave server at a particular frequency.
3. Create a crontab file to invoke these NIS scripts at regular intervals. For
information about creating crontab, see cron (1M).
Following is a sample crontab file:
0 21 * * * /var/yp/ypxfr_1perday
30 5,19 * * * /var/yp/ypxfr_2perday
15 * * * * /var/yp/ypxfr_1perhour
The crontab file runs the ypxfr_1perday script at 9:00 p.m. every night, and
the ypxfr_2perday script at 5:30 a.m. and 7:30 p.m. every day. It runs the
ypxfr_1perhour script at 15 minutes past every hour.
4. Add a file to crontab:
# crontab filename
where:
filename is the crontab file created in step 3.
If you have created customized NIS maps for your domain, you must add the map
names to the appropriate scripts. You can also use the sample scripts as templates to
create your own scripts.
In some domains, frequently transferring huge maps may generate excessive network
traffic. To avoid this, you can schedule map transfers less frequently by editing the
/var/yp/ypxfer_1perhour script. You must create a new script that contains the
/etc/passwd file to be run at the desired lower frequency.
If you have multiple slave servers, ensure that a different time is specified for each
slave server in the crontab file to prevent network congestion due to simultaneous
map transfer to all the servers.
For more information, see cron (1M), crontab (1), and ypxfr (1M).
Allowing Selected Clients to Access the Slave Server
To selectively allow clients to access the slave server, complete the following steps:
1. On the NIS slave server, create the /var/yp/securenets file if it does not exist.
2. Add entries to the /var/yp/securenets file:
address_mask IP_address
Allowing Selected Clients to Access the Slave Server 49