GET Command


HSI Version: 



Retrieves a copy of a file from HPSS to your local file space on the host system.



Command Format: 

g[et] [-A] [-B | -b] [-C][-c on|off] [-F on|off [-h] [-k] [-L path] [-N] [-o] [-O srcofs:sinkofs:length] [-P | -p] [-Q] [-R | -r] [-S] [-T on|off] [-t] [-U | -u][-X max]
[path ...] [<<MARKER] 


-A : enable auto-scheduling for file retrievals.  This is the default unless auto-scheduling has been disabled.  Auto-scheduling results in optimizing tape mounts and tape positioning for retrieval of files that live on tape.

-B | -b : backup option. Renames any existing local file by appending "~". (This option may not be used with -L,-t, or -O)

-C : cache purge option. If specified, purge files from HPSS disk cache after a successful get. Normally used only when it's expected that files will only be fetched once (or infrequently), to help optimize disk cache use.

-c on | off : enable or disable verification of HPSS checksums that are stored separately from the file data in HPSS. This option overrides both the default compile-time option, and the hsirc setting for enabling/disabling checksums. Checksums are created either by storing files with checksums enabled (see the PUT command), or by using the HASHCREATE command to generate a checksum for an existing HPSS file..

-F on|off :  enables or disables use of the HPSS Local File Mover for file transfers, overriding the cconfiguration option(s).

-h : symlink option. If specified, create local symlink if HPSS symlink. If not set, reads through HPSS symlinks when copying files to local filesystem

-k: keep partially transferred files if error(s) are encountered. Default is to attempt to delete any partially transferred local file if errors occur.

-L path : pathname of a file containing lists of partial file offsets, in the form specified by -O (see below). Multiple entries per line may be specified. -O option(s), if any, are processed before any -L entries

-N : disable auto-scheduling of retrievals. Default is to schedule retrievals in an optimal way so as to minimize HPSS tape mounts

-O : partial file transfer. "srcofs" is the source file offset, "sinkofs" is the sink file offset, "length" is the transfer length. Missing options use defaults (src: 0, sink: 0, length: entire file). "CP" or "0CP" (case-insensitve) can be used to specify "current position". Multiple -O options may be specified, and are processed in order. Offsets may specified with case-insensitive suffixes "k", "kb",etc.

-P:  reserved for future use

-p : preserve timestamp. Attempts to copy HPSS file's timestamp to local file.

-Q: If running as local root user, attempts to preserve the HPSS UID and GID on the local file(s).

-R | -r : recursively fetch directories

-S : disable staging of the source file (attempts to read directly from tape). Users having trouble retrieving files over 25 GB in size may wish to use the -S option for the get or mget commands. The -S option was added to allow users to disable staging files from tape, specifically for this type of situation.

-T on|off : enable or disable the use of the HPSS Transfer Agent for I/O, overriding 
any configuration option(s).

-t : "re-get" option. Restart a previously failed operation. This is equivalent to "-O sizeof(localfile):sizeof(localfile):0". Note: -t may not be used with -O or -L

-U | -u : update option. Only copy file from HPSS if local file timestamp is older

-X max : [] set maximum concurrent transfers for this command. This may only be used to reduce, not increase, the value set by the HPSS administrator.

MARKER : provides sh-style "here"-document syntax for specifying filenames.

  • MARKER may optionally be preceded by one or more whitespace characters following the here document sentinel "<<";
  • Lines following the MARKER, which must be the last item on the line, contain pathnames (which may include wildcards).
  • The list is terminated by a line containing MARKER as the first token on the line.



Usage Notes: 

1. If either -O,-L is specified, the offsets apply only to the first file transferred.

2. See  FTP Compatibility and Path Names  for information on valid characters and renaming files on get and put commands

3. See Using PIPEs for Input/Output for information on piping files from HPSS into an operating system utility or to the TTY

4. See the "Restricted TCP Ports and Restricted Hosts" topic for information on dealing with firewalls

5. The shell-style HERE-Document syntax can be used to specify an interactive list of paths, or can be used in an IN file:

Interactive mode:

hsi get file1 file2 << EOF
FILENAMES: file3 file4

Using an IN File:

hsi in stageInput

Contents of file "stageInput"

get file1 file2 << EOF
file1 : hpss_file1 file2 : hpss_file2 file3 file4
file5 : hpss_file5


1. Get an hpss file call "hpss_file_name" to a local file called "local_file_name"
      get local_file_name : hpss_file_name
2. Recursively retrieve all of the files in the current directory that end with .c, and all of the files in the directories "Project1" and "Project2"
      get -R *.c Project1 Project2
3. Get the file "precious_data", verifying the checksum that was previously created by storing it with put -con precious_data
    get -con precious_data
4. Get the file "myHPSSfile.tar.gz" to a local pipeline which uncompresses and untar-s the file.
   get "| gunzip | tar xvf - " : myHPSSfile.tar.gz

Related Command(s):