[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 4


nistbladm Command

Purpose

Administers NIS+ tables.

Syntax

To add or overwrite table entries

nistbladm -a |  -A-D Defaults ] { Col_name=Value... Tbl_name } | { Entry_name }

To create an NIS+ table

nistbladm -c-D Defaults ] [  -p Path ] [  -s Sep ] Type Col_name=[  S ] [  I ] [  C ] [  B ] [  X ] [ Access ]... Tbl_name

To delete an entire NIS+ table

nistbladm -d Tbl_name

To edit table entries

nistbladm -e |  -E Col_name=Value... Entry_name

To remove table entries

nistbladm -r |  -R { [ Col_name=Value... ] Tbl_name } | { Entry_name }

To update a table's attributes

nistbladm -u-p Path ] [  -s Sep ] [  -t Type ] [ Col_name=Access... ] Tbl_name

Description

The nistbladm command is used to administer NIS+ tables. It performs five primary operations: creating tables, deleting tables, adding table entries, modifying table entries, and removing table entries.

Though NIS+ does not restrict the size of tables or entries, the size of data affects the performance and the disk space requirements of the NIS+ server. NIS+ is not designed to store huge amounts of data, such as files. Instead, you should store pointers to files located on other servers. NIS+ can support up to 10,000 objects totaling 10M bytes. If the you need more storage space, you should create the domain hierarchy, or use the data stored in the tables as pointers to the actual data, instead of storing the actual data in NIS+.

To create a table, its directory must already exist and you must have create rights to that directory. You must specify a table name, table type, and a list of column definitions. Type is a string that acts as a standard by which NIS+ verifies that entries are of the correct type.

To delete a table, you must have destroy rights to the directory where it is stored. To modify entries, whether adding, changing, or deleting, you must have modify rights to the tables or individual entries.

Flags


-a Addds a new entry to an NIS+ table. Create the entry's contents by supplying Col_name=Value pairs on the command line.

Notes:
  1. You must specify a value for each column when adding an entry to an NIS+ table.
  2. When entering the value string, enclose terminal characters in single quotes (') or double quotes ("). Those characters are the equals sign (=), comma (,), left bracket ([), right bracket (]), and space ( ). They are sparsed by NIS+ within an indexed name.
With the -a flag, the nistbladm command reports an error if you attempt to add an entry that would overwrite a pre-existing value in the desired column. nistbladm does not automatically overwrite pre-existing entry values. (See the -A flag for information about overwriting entries.)
-A Forces the nistbladm command to overwrite a pre-existing entry value. Even if Col_name already contains a value, nistbladm overwrites the old value with the new value. Unlike with the -a flag, the nistbladm command does not return an error.
-c Tbl_name Creates a new NIS+ table named in the parameter Tbl_name. When creating a table, you must specify a table type, entry type, and a list of column definitions. The syntax for column definitions is Col_name=[ Flags ] [ Access ]. The parameter Flags can have these possible values:

S
Speciies that searches can be performed on the column's values.

I
Specifies that searches ignore the case of column values. This flag is only valid in combination with the S flag.

C
Encrypts the column's values.

B
Sets the column's values as binary data. If the B flag is not set, column values are null-terminated ASCII strings. This flag is only valid in combination with the S flag.

X
Sets the column's values as XDR-encoded data. The X flag is only valid in combination with the B flag.

The newly created table must contain at least one column in number and at least one searchable column; in other words, if Tbl_name only has only one column, that column must be searchable.

-d Tbl_name Deletes the entire table indicated in the parameter Tbl_name. The table must be empty before you delete it. (Use the -R flag to delete a table's contents.)
-D Specifies a set of defaults to be used when new objects are created. The defaults string is a series of tokens separated by colons. These tokens represent the default values to be used for the generic object properties.

ttl=Time
Sets the default time-to-live for objects created by the nistbladm command. The value Time must be given in the format defined by the nischttl command. The default value is 12 hours.

owner=Ownername
Specifies that the NIS+ principal Ownername should own the created object. The default value is the the same as the principal who executes the nistbladm command to create the object.

group=Groupname
Specifies that the group Groupname should be the group owner for the object created. The default value is NULL.

access=Rights
Specifies the set of access rights to be granted for the given object. The value Rights must be given in the format defined by the nischmod command. The default value is ----rmcdr---r---.
-e Entry_name Edits the entry specified by Entry_name. Entry_name must uniquely identify only one single entry. While editing the value of Entry_name, you can also change that entry's indexed name.

Note: If the entry's new indexed name (resulting from the edit) matches that of another's entry, the nistbladm command fails and returns an error message.
-E Entry_name Edits the entry specified by Entry_name. Entry_name must uniquely identify only one single entry.

Note: If the new indexed name matches that of another entry, then the -E flag automatically overwrites that existing entry with the entry just edited. So, in effect, two entries are being replaced by one.
-r Removes an entry from a table. Either identify the entry by its indexed name in Entry_value, or by a series of Col_name=Value pairs on the command line. With the -r flag, the nistbladm command fails when the indexed name or the column=value pairs match more than one entry.
-R Removes multiple entries from a table. The -R flag forces the nistbladm command to remove all entries that match the criterion for removal. If that criterion is null--if you do not specify column=value pairs or an indexed name--then all entries from the table are removed.
-u Updates attributes of a table. This allows the concatenation path, separation character, column access rights, and table type string of a table to be changed. Neither the number of columns nor the number of searchable columns can be changed with this flag.
-p Path Specifies the table's search path when creating or modifying a table. When you invoke the nis_list function, you can specify the flag FOLLOW_PATH to tell the client library to continue searching tables in Path if the search criteria does not yield any entries. The path consists of an ordered list of table names separated by colons. The names in the path must be fully qualified.
-s Sep Specifies the table's separator character when creating or modifying a table. The separator character is used by the niscat command when writing tables to standard output. The purpose of the separator character is to separate column data when the table is in ASCII form. The default value is a <space>.
-t Type Specifies the tables's Type string when modifying a table.

Exit Status


0 Successful completion.
1 An error occurred.

Environment Variables


NIS_DEFAULTS Contains a defaults string that overrides the NIS+ standard defaults. However, if you specify different values with the -D flag, then those values overrides both the NIS_DEFAULTS variable and the standard defaults.
NIS_PATH If Tbl_name is not fully qualified, then setting this variable instructs nistbladm to search each directory specified until the table is found.

Examples

  1. To create a table named hobbies in the directory abc.com. of the type hobby_tbl with two searchable columns name and hobby, enter:

    nistbladm -c hobby_tbl name=S,a+r,o+m hobby=S,a+r hobbies.abc.com.
    

    The column name has read access for all (owner, group, and world) and modify access for only the owner. The column hobby has read access for all but cannot be modified by anyone.

    If access rights are not specified, then the table access rights would be either the standard defaults or those specified by the NIS_DEFAULTS variable.

  2. Too add entries to the hobbies table, enter:

    nistbladm -a name=bob hobby=skiing hobbies.abc.com.
     
    nistbladm -a name=sue hobby=skiing hobbies.abc.com.
     
    nistbladm -a name=ted hobby=swimming hobbies.abc.com.
    
  3. To add the concatenation path, enter:

    nistbladm -u -p hobbies.xyz.com.:hobbies.def.com. hobbies
    
  4. To delete skiing-enthusiasts from the table, enter:

    nistbladm -R hobby=skiing hobbies.abc.com.
    

    Note: Using the -r flag in this example would fail because two entries contain the value skiing.
  5. To create a table with a column that is named with no flags set, enter:

    nistbladm -c notes_tbl_ name=S,a+r,o+m note=notes.abc.com.
    

    This command string creates the table notes.abc.com. of the type notes_tbl with the two columns, name and note. The note column is not searchable.

Related Information

The niscat command, the nischmod command, the nischown command, the nisdefaults command, the nismatch command, and the nissetup command.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]