The nsrck program checks the consistency of the Backup online index of clients' save sets.
Use the nsrck to check the consistency of the Backup client file indexes. Typically, the nsrck program is automatically started by the nsrindexdstartup. The .nsrck file is locked upon program execution; therefore, only one instance of nsrck can run on the server.
You can restart the nsrck program at any time during its execution. Therefore, it can survive system crashes or exhaustion of resources without losing data.
Index consistency checking is done in up to four phases:
Phase zero determines whether a client's index requires further investigation. This phase checks the internal state of the index and, if that state is consistent, avoids further passes. Phase zero also reports index names that appear to be suspicious (for example, indexes whose names do not map to valid network addresses).
Phase one fixes any errors found in the database record file, db, and rebuilds the b-tree indexes for the database, if necessary.
If you specify the -X option, nsrck invokes phase two, which cross-checks the client file index with the media database. Records that do not have existing, browsable save set entries are deleted.
If the database requires compression, either due to space freed by the previous phases or due to a state flagged by a previous run, the index is compressed during phase three.
Index compression is a two- or three-step process. First, the records of the database are copied to a temporary database, db.CMP. When that operation is completed, a flag file, db.SVC, is created; the old, uncompressed database is removed; and the compressed database is renamed to db. Finally, the db.SVC file is removed. If there is not enough room on the filesystem containing the db file to include the temporary database also, nsrck creates a temporary file on another writable filesystem. It stores a pointer to this file in a file named db.PTR. In this case, an extra copy of the data is required, because the uncompressed database must first be removed before the data can be copied back to the correct place. After all these steps are completed, the db.PTR file is removed.
The following example describes the format and options available for the nsrck program:
nsrck [-qM] | [-T tempdir] [-X [-x percent] | -C | -F | -m] [clientname...] |
Use the -C option to force index compression on the named clients, or all clients if none are specified. Other phases of checking are only performed if an error in a database is detected.
Use the -F option to force a check on the listed client names. If no names are given, forced checks are performed for all client indexes. This option forces all phases of index checking. For backward compatibility, the -F option implies index compression, and may be used to force the index to be compressed. This option is typically only necessary when the browse policy is reduced (for example, if the browse policy is changed from 1 year to 6 months). See "NSR policy " for information on the policy resource.
Use the -M option to use the nsrck program in master mode (not advised for manual operation). This option advises nsrck that nsrd or another Backup daemon invoked nsrck and logs messages with timestamps, as well as performs any other behavior expected by nsrd.
Use the -m option to force nsrck to check and rebuild the media database b-tree indexes, instead of checking a client's online file index.
Use the -q option to use nsrck in quiet mode. Quiet mode suppresses all advisory messages.
Use the -T option to specify the directory for nsrck to use to hold the temporary database during compression, if there is not enough room in the filesystem containing the db file. If you use this option and there is insufficient space in the specified temporary directory, the nsrck program fails. This argument is ignored if there is sufficient space in the filesystem containing the db file.
Use the -X option to tell nsrck to cross-check the ssids in the index records with save sets found in the media database instead of checking the index databases (unless an error in phase zero occurs). Records that do not correspond to media save sets are discarded. If specific clients are listed, the cross-check is limited to those client indexes.
Use the -x option to compress a database after it has been cross-checked, if the database uses less than the specified percent of the UNIXfile. The unused pages are returned back to the filesystem. The default percentage for the -x option is 30.