NSRCK(8)

NAME
nsrck - NetWorker index consistency check, repair, and recovery program

SYNOPSIS
nsrck [ -qMv ] | [ -R [ -Y ] ] [ -L check-level [ -t date ] | -X [ -x percent ] | -C | -F | -m | -c ] [ -T tempdir ] [ clientname ... ]

DESCRIPTION
nsrck is used to check the consistency of the NetWorker online index of clients' save records. Normally, nsrck is started automatically and synchronously by the nsrindexd(8) program when nsrindexd starts. You can modify the nsrck modes to allow normal users to run nsrck and retain root privileges (see nsr(8) for more details).

When nsrindexd starts up, it determines whether any further checking of a client's index is necessary. This phase checks certain internal state of the index database, and if that state is consistent, avoids further passes. This phase also reports any suspicious-looking index names (that is indexes whose names cannot be mapped into network addresses). These online file indexes are then checked more rigorously.

nsrck detects whether any client indexes need to be converted and does the proper conversion. Converting the indices takes free space on the volume that contains the indices; if there is not sufficient free space, you may use the -T tempdir flag to specify a different directory which the conversion will use as its work space. You may also manually convert client indices by issuing the nsrck commmand manually.

There are seven different checking levels supported by nsrck. If client names are supplied, the check is performed on the given client names. If no names are given, the checks are performed for all client indexes. The check levels work as follows for each client checked:

Level 1 validates the online file index header, merging a journal of changes with the existing header.

Level 2 does a level 1 check and checks the online file index for new and cancelled saves. New saves are added to the online file index, and cancelled saves are removed.

Level 3 does a level 2 check and reconciles the online file index with the online media index. Records that have no corresponding media save sets are discarded.

Level 4 does a level 3 check and checks the validity of the online file index's internal key files. If any of these key files are invalid, they are rebuilt.

Level 5 does a level 4 check and verifies the digest of individual save times against their key files.

Level 6 does a level 5 check and extracts each record from each save time, verifying that each record can be extracted from the database. The digest of each save time is re-computed and compared against the stored digest, and the internal key files are rebuilt.

Level 7 recovers an online file index from backup media, rebuilds the internal key files, and rebuilds the index header. The -t date option may be used to recover the index as of a specific time. Note that recovering the index to a specific time adds the entire contents of the index as of that time to the current index contents. This option allows browsing of save sets that have passed their browse policy and are still recoverable. The save sets referred to by the recovered index will be marked as browsable. They will remain browsable for the length of time they were originally browsable.

Checks of a higher level generally take longer than checks at a lower level. Checks at a higher level provide a more thorough checking of the online file index. Level 7 is used when the online file index on disk needs to be recovered from backup media. The nsrck program is restartable at any time during its execution. Therefore, it can survive system crashes or exhaustion of resources without losing data.

OPTIONS

-C  This option validates the client's online file index header. It is identical to specifying the -L 1 option.

-c  This option is the same as using -L 2.

-F  This option is the same as using -L 2.

-t date
    Recover the index as of the specified date (in nsr_getdate(3) format). This option is only valid with the -L 7 option.

-T tempdir
    Specifies a different directory to use for conversion. This is useful if your client indexes are on file systems that are nearly full. It will enable the conversion to use the tempdir specified as a work space for converting indexes. It is not recommended to use /tmp, since its contents are lost if your machine is rebooted.

-L level
    Specifies the level of checking to use. The valid levels are 1-7.

-M  Master mode (not advised for manual operation). This advises nsrck that it is being run by nsrd(8) or another NetWorker daemon and should log messages with timestamps, and perform any other behavior expected by nsrd.

-m  Forces nsrck to check and rebuild the media database b-tree indexes, instead of checking a client's online file index.

-q  Quiet mode. All advisory messages are suppressed.

-v  Verbose mode. Advisory messages are emitted.

-R  Removes the index for the client. This is valid only when the -Y option is also specified. If the nsrck is not in master mode, the user will be prompted with a warning indicating which online file indexes will be completely removed and given an opportunity to kill the commmand if this was not what the user intended.

-X  This is the same as using -L 3

-x percent
    This is the same as using -L 1. The "percent" value is ignored, but permitted. This allows customer scripts using this option to continue working.

-Y  Used in conjunction with -R to remove online file indexes. Using this flag means that you really do wish to remove the online file index(es). If you fail to use this flag with the -R option, you will be warned that you need to add the -Y flag to the nsrck command.

FILES

/nsr/index/ clientname /db6/nsrck.lck
    nsrck locks this file thereby insuring that only one copy of nsrck is checking a client's index.

/nsr/index/clientname

/nsr/index/clientname/db6

SEE ALSO
nsr_layout(5), nsr_policy(5), hosts(5), nsr(8), nsrd(8), nsrindexd(8), nsrmmdbd(8), nsrim(8), savegrp(8)

DIAGNOSTICS

checking index for clientname
    Informative message that the files associated with the named client are being inspected.

WARNING no valid savetimes - cross-check not performed for clientname
    During a cross-check, no save sets were found for this client. Since this situation can occur during disaster recovery, nsrck avoids deleting the entire contents client index.

cross-checking index for clientname
    Displayed when the -L 3 option is in effect.

completed checking count clients
    Displayed as the program finishes, provided some form of checking was accomplished.