ICC Home Privacy and Legal Notice LC User Documents Banner


HTAR Reference Manual

Retrieving Files from within an Archive

To retrieve several files from within an existing stored HTAR archive file (without retrieving the whole archive first).
HTAR does not process metacharacters (file filters such as *) itself, but leaves them for the shell to expand and compare with file names in your local directory. Hence, you CANNOT use * to select a subset of already archived files to retrieve. For example, "natural" execute lines
     htar -xvf case3/myproject.tar time*     [WRONG]
     htar -xvf case3/myproject.tar 'time*'   [WRONG]

both FAIL to select (and hence to retrieve) any stored files from the MYPROJECTS.TAR stored archive (each yields its own set of error messages). These lines work only accidentally, if you happen to have files with the same name in both your local directory and your stored archive (unlikely except when you are just testing HTAR).
(1A) Type the name of each file that you want to retrieve (at the end of the HTAR execute line).
(1B) If you have a long list of files to retrieve, or if you plan to reuse the same retrieval list often, put the list of sought files into a file and use HTAR's -L option to invoke that list. You can use HTAR's -t (reporting) option to help generate that retrieval list by reporting all the files you have archived and then editing that report to include only the relevant file names to retrieve. For instance,
     htar -tf case3/myproject.tar > hout
     grep 'time' hout | cut -c 50-80 > tlist

captures the list of all your stored files in the local file HOUT and then selects just the file names that contain the string TIME for use with HTAR's -L option (here, in local file TLIST). Note that HTAR automatically appends slash (/) at the end of every directory name that -t reports.
(1C) Use HOPPER to run HTAR as a controllee, then select visually the files that you want to retrieve.

(1) Once you have laid the groundwork above, a single HTAR execute line can retrieve your specified files quickly and in parallel from within your stored archive:
  • The -xvf options request retrieval/extraction (x), verbosely (v) report the retrieved files, and (f) name the target archive.
  • The relative pathname case3/myproject.tar locates the archive (myproject.tar) in pre-existing subdirectory case3 of your storage home directory.
  • The explicit file list (1A) or name-containing file (1B) selects all and only the files that you want (here, those whose names begin with TIME, a subset of all files stored in this archive in the previous example).

(2) HTAR opens a preauthenticated connection to your storage (HPSS) home directory and reports its housekeeping activities (very quickly, in lines that overwrite, so you may not notice all of these status reports on your screen).
(3) HTAR uses its external index to locate in the archive the (two) specific files that you requested and then it transfers them by using parallel connections (but not the PFTP client) to your local machine without retrieving the whole archive file.
(4) HTAR summarizes the work done (time, rate, amount) and then ends.
htar -xvf case3/myproject.tar time.txt time2.gif           ---(1A)
htar -xvf case3/myproject.tar -L tlist                     ---(1B)

  HTAR: Opening HPSS server connection                     ---(2)
  HTAR: Reading index file
  HTAR: Opening archive file

  HTAR: Reading archive file                               ---(3)
  HTAR: x  time.txt, 1085 bytes, 4 media blocks
  HTAR: x  time2.gif, 3452 bytes, 8 media blocks

  HTAR: Extract complete for case3/myproject.tar,          ---(4)
        2 files. total bytes read 116,736 in 0.070 seconds (1.669 MB/s)

Navigation Links: [ Document List ] [ HPC Home ] [ Previous ]

No content in this section. Showing first subtopic...