|Skip Navigation Links|
|Exit Print View|
|System Administration Guide: Naming and Directory Services (NIS+)|
The nisrestore command recreates NIS+ directory objects to match the data stored in backup files created with the nisbackup command. This command can be used to restore NIS+ servers, replace directory objects that have become corrupted, or down load NIS+ data on to a new NIS+ server.
In order to use nisrestore the target machine that will be receiving the NIS+ data from nisrestore must have already been set up as an NIS+ server. For a detailed description of setting up NIS+ servers, see Chapter 4, Configuring NIS+ With Scripts.
The prerequisites to using nisrestore are:
The machine must have already been initialized as an NIS+ client.
If you are using nisrestore on a server while other servers in the namespace are up and running, nisrestore will verify with those other servers that this server is configured to serve the backed up NIS+ objects that you are restoring to it. If no other servers are up and running in your namespace, then you must run nisrestore with the -f option. In other words, if there are other servers that nisrestore can check with, you do not need to use the -f option. If no other servers are available, for example if you are restoring a single master server and there are no functioning replica servers, then you must use the -f option.
Caution - In addition to the preceding three prerequisites, the rpc.nisd daemon must not be running on the machine. If necessary, you must kill rpc.nisd, by stopping the NIS+ service, before running nisrestore.
The nisrestore command uses the following syntax:
nisrestore [-fv][-a][-t] backupdir [directory_objects]
Backupdir is the directory containing the backup files to be used to restore the NIS+ objects. For example, /var/master1_bakup.
Directory_objects are the NIS+ directory objects that you want to restore. For example, org_dir.doc.com. Multiple NIS+ directory objects can be listed separated by spaces. (If you run nisrestore with the -a option, you do not specify specific directory objects.)
The nisrestore command takes the following options.
Table 21-2 Options for the nisrestore Command
For example, to restore the org_dir.doc.com. directory object on the replica1 server, you would log in as root on replica1, make sure that the prerequisites described in Prerequisites to Running nisrestore have been met and then run nisrestore as shown below:
replica1# nisrestore /var/master1_bakup org_dir.doc.com.
The following points apply to nisrestore:
For example, to reload NIS+ data on a root master server named master1, you would enter the following.
master1# nisrestore -f -a /var/master1_bakup