Chapter 2: Working With HPSS
|
HSI can be used in an interactive session with a response for each request entered at the keyboard; it can also be used in single-line execution mode interactively or within shell scripts, or called from an executing program, using the system() function..
As HSI processes a request, it engages in a network dialogue with various
components of the HPSS system. At times, due to network or other activity,
it may appear as though HSI is `hung', although internally all functions are
issued with timeout and retry logic which will quit after a reasonable time
has expired with no response. You, as an interactive user, can take action
to stop the continued wait and retry cycle. The actions available depend on
which operating system you are using; normally typing ^C (control-C) will
cause the current command to be interrupted.
The HSI command line has the following general format:
hsi [options] [command [parameter(s)]] [ ; command [parameters]] ...
In interactive mode, if no commands are encountered, HSI will prompt for input, ending the session when the END command (or one of its aliases) is entered.
HSI can also be used in one-liner mode by placing all of the commands on the startup line, separated by semicolons (";"). Note that it may be necessary to enclose the entire command string in quotes to protect it from interpretation by the shell - see Section 8.7 - Operating Considerations for One-Liners for more information.
In one-liner mode, all commands on the startup line are processed, then HSI terminates execution. This is the normal mode for shell scripts and batch jobs.
Options are used to set initial operating modes for HSI, and are listed below:
| -A authmethod | (non-DCE HSI version only) Specifies the authentication
method to be used. The authmethod parameter is not case-sensitive.
Possible settings are:
|
| -d | enables debugging messages at startup. The |
| -e | Enables echoing of lines read from |
| -F char | specifies the pathname separator for specifying different local and HPSS pathnames for the same file |
| -g number | sets the maximum number of matched entries allowed for filename "globbing" (pattern-matching). This option is usually unneeded, but was provided for abnormal situations. |
| -h hostname or hostname/port |
(Non-DCE version only). Specifies the hostname or
host IP address and (optionally) the port for connecting to the non-DCE
server. The default port number assigned by the IANA is 1217. This option
can also be specified by setting the |
| -kkeytab_path | Specifies the path to the DCE keytab file to be used
to obtain credentials. This applies to both the DCE and non-DCE versions
of HSI; however, it only has meaning for the non-DCE HSI if |
| -l login_name | Specifies an alternate login name to use. For DCE
combo authentication and keytab authentication, this name is the DCE
principal to be used.
For Kerberos authentication, it is the Kerberos principal name, and
should be of the form |
| -q | sets "quiet" mode. In this mode, non-essential messages are suppressed, for example, the "Username" message and the HPSS announcement messages will not be displayed if this option is selected |
| -s sitename | Specifies the remote site, defined in a stanza within the .hsirc file, to connect to. For example, the command: % hsi -s SDSC would connect to the SDSC HPSS if a user had the following stanza in their .hsirc file: SDSC: |
Both of these files are stored in local storage, not in the user's HPSS space. HSI also will look for a startup file in the user's HPSS home directory after authentication has completed successfully. However, it is not recommended that users create a ~/.hsirc file in their HPSS home directory; if this file is migrated to tape and purged from disk, then the HSI startup process will take a long time, particularly if there is contention for tape drives within HPSS.
Startup files are used to contain startup options for HSI. Input lines in
the file consist of comments and directives.
option = value
Note that the spaces surrounding the "=" are required.
Currently recognized options are:
The default prompt string ? can be replaced with a string of the user's choosing. Metacharacters of the form "%x are expanded each time the prompt is displayed. The following metacharacters are currently supported:
For example, to set the default prompt to the current HPSS working directory,
followed by the string "->", the following line could be inserted
in the .hsirc file:
PS1 = "%W->"
[ PAGE TOP ]
An HSI request is your input to HPSS to accomplish a desired function. You sign on to a computer and run the HSI utility program to communicate with HPSS. HSI can be used interactively, but it can also be used in single-line execution mode or called from an executing program or a command-language script (for example, as part of a batch job).
You start HSI by entering
 hsi <return>
After login validation has completed, you will receive any startup messages and the prompt (normally a question mark "? ") indicating that HSI is ready to accept input. (See the PS1 keyword, and the .hsirc startup file for info on changing the prompt string).
You can then enter HSI commands. When you are ready to finish, enter
 quit <return>
(Note that there are aliases for the "quit" command, such as "end", which will all cause HSI to terminate.)
[ PAGE TOP ]
The basic format for all HSI requests is
[ PAGE TOP ]
HSI returns a response for each request entered. The response shows whether the request was executed successfully or was not completed due to some error. If an error occurred, the response indicates why the request failed.
The basic format of a normal response is
Refer to Chapter 4, HSI Responses, for more information about responses and to HSI Return Codes for a listing of HSI error responses.
[ PAGE TOP ]
HPSS supports a hierarchical storage structure called a tree, which consists of segments called nodes:
A file descriptor node is created when a file is first stored on HPSS. It contains information about the file, such as its size and hierarchy ID, but not the actual file data. File descriptor nodes cannot have descendants.
File trees, when illustrated, are customarily shown as inverted. The root is shown at the top with descendant nodes beneath it. Connecting branches show the relationships between the nodes and the root (see the Simple Tree example). If you need to save only a few files, you can probably use a simple tree (one with no subdirectories). Complex trees (those with subdirectories) are described in Chapter 5: Tree Structures, Directories and Paths
[ PAGE TOP ]
2.8 Paths and Working Directories
To store or retrieve a file in an HPSS tree, you may specify to HSI the complete path from the root node to the file node. The name of each node is preceded by a slash (/) and then chained together from the root downward to form the complete path. The maximum length of each node name is 255 characters. The maximum total path length, including slashes, is 1023 characters.In the simple tree shown in the Simple Tree example, the complete path to the file "Data1" is
Example: using the default working directory path name
There are nine other working directories. Using these directories is optional and requires planning, but they are helpful when dealing with multiple trees or with requests that require two paths. See Chapter 5, Tree Structures, Directories, and Paths, for more information.
[ PAGE TOP ]
2.9 HPSS Security and File Sharing
To execute an HSI command successfully, the user must have access to the affected files or directories as per normal UNIX file systems:In addition, you may be placed as a member of one or more administrative groups, each of which is known to HPSS by a Group ID, or GID. When HPSS validates your access rights to files, it takes into account all GIDs of which you are a member. The list of groups to which you belong is also referred to as your group vector.
If you expect to share files with other users, you will need to understand access rights. All files are protected against unauthorized access. You can give other users access through the proper combination of permission bits. See Chapter 6, Security and File Sharing, for more information.
HPSS supports ACLs for multilevel security. However, ACL support is not included in HSI at this time.
[ PAGE TOP ]
Interactive use of HSI involves the following activities:
Example: interactive use of HSI
[ PAGE TOP ]
In single-line execution mode (one-liners), the HSI invocation and all the requests are included in one execute line. When a <RETURN> is entered, each request is executed, HSI ends, and control returns to the operating system of the local computer. You can continue request input on a second line with a backslash (\) as the last character of the line, and single-line execution will still be in effect (see Request Format Rules in Section 3.2).
The execute line for single- line execution has the form:
In the following example, the one-liner accomplishes some of the same tasks as the interactive session shown in the previous example. The space following "hsi" and the semicolonss between requests are required. Additional spaces are permitted. The command is placed in double quotes to preclude interpretation by a Unix command shell interpreter program.
Example: single-line execution
[ PAGE TOP ]
HSI may also be used in scripts and batch files. It may be started from executables via the system() command.
[ PAGE TOP ]