You can transfer information from an NIS map in two different ways; either by specifying the NIS domain or by specifying the actual NIS map. If you specify the domain, NIS+ will figure out which map file in /var/yp/nisdomain to use as the source, based on the table-type. Note that /var/yp/nisdomain must be local files.
NIS+ Table Type |
NIS Map Name |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Protocols |
|
|
|
|
|
To transfer by specifying the NIS domain, use the -y (lowercase) option and provide the NIS domain in addition to the NIS+ table type.
Table replacement
nisaddent -y nisdomain table-type |
Table append
nisaddent -a -y nisdomain table-type |
Table merge
nisaddent -m -y nisdomain table-type |
By default, nisaddent replaces the contents of the NIS+ table with the contents of the NIS map. Use the -a and -m options to append or merge. Here is an example that loads the NIS+ passwd table from its corresponding NIS map (passwd.byname
) in the old-doc domain:
rootmaster# /usr/lib/nis/nisaddent -y old-doc passwd |
This example does the same thing, but for the sales.doc.com. domain instead of the local domain, doc.com.
rootmaster# /usr/lib/nis/nisaddent -y old-doc passwd sales.doc.com. |
If the NIS+ table is an automounter table or a nonstandard table, add the -t option and the complete name of the NIS table, just as you would if the source were a file.
rootmaster# nisaddent -y old-doc \ -t auto_home.org_dir.doc.com. key-value rootmaster# nisaddent -y old-doc \ -t auto_home.org_dir.doc.com. key-value sales.doc.com. |
If instead of using the map files for a domain, you prefer to specify a particular NIS map, use the -Y (uppercase) option and specify the map name.
rootmaster# nisaddent -Y hosts.byname hosts rootmaster# nisaddent -Y hosts.byname hosts sales.doc.com. |
If the NIS map is an automounter map or a non standard map, combine the -Y option with the -t option:
rootmaster# nisaddent -Y auto_home -t auto_home.org_dir.doc.com. key-value rootmaster# nisaddent -Y auto_home -t auto_home.org_dir.doc.com. key-value sales.doc.com. |