The limreport and limadm commands provide the administrator with an easy way to save and restore the contents of lnodes for any number of users. Use the limreport command to select and extract the lnodes that are to be saved, and use limadm to restore them. This combination of commands is most commonly used for copying lnodes and for altering the lnode structure, as discussed in the following sections.
The limreport command also provides a flexible way to select and display users' attributes. It provides two levels of selection: selection of lnodes, and selection of attributes to be displayed for each lnode selected. The lnode selection is achieved by specification of a select-expression, which may be a single condition or a set of conditions joined by logical operators in a C-style syntax. The attribute selection is achieved by listing the attributes' symbolic names. The way in which the attributes will be displayed is specified by a format control string, similar to the C function limreport, with extensions to handle special Solaris Resource Manager types. If a format control string of '-' is specified, limreport uses default formats for each attribute displayed. Refer to limreport(1SRM) for further details.
The limadm command provides a facility to indivisibly change the contents of attributes within lnodes, given that the invoker has sufficient privilege. Change commands can be specified directly on the command line, or the name of a file containing the change commands can be specified (by using the -f option).
The limreport command is able to generate attribute value assignments using the limadm syntax (refer to the preserve identifier in the limadm syntax), the output of which can be input to limreport using the -f option. This allows the administrator to use the two programs together to selectively save and restore the contents of the limits database.
# limreport 'uid==X' - Y preserve | limadm set -u -f -
will copy an lnode from UID X to UID Y. The expression uid==X provides the method for selecting the source lnode. The preserve identifier causes limreport to output all attribute values that are not read-only in a syntax that is suitable to pass to limadm. Placing the UID Y prior to the preserve identifier causes this to be the first item in the data passed to the limadm, thus providing the selection of the target lnode.
If the source lnode is no longer required, it can be removed using limadm.
Be careful when using a match by UID as the limreport selection expression. If multiple login names share a UID, they will all be matched. In the example above, this would not matter; the same lnode data will be preserved and loaded multiple times. In the Solaris environment, UID 0 has login names of both root and smtp.