- class wxflow.Htar[source]¶
Class offering an interface to HPSS via the htar utility.
Examples:¶
>>> from wxflow import Htar >>> htar = Htar() # Generates an Executable object of "htar" >>> output = htar.cvf("/HPSS/path/to/archive.tar", "file1 file2") # Create an HPSS archive from two local files >>> output = htar.tell("/HPSS/path/to/archive.tar") # List the contents of an archive
- create(tarball: str, fileset: List | str, dereference: bool = False, opts: List | str = '-P') str [source]¶
Method to write an archive to HPSS
- Parameters:
opts (str | list) – Options to send to htar. By default, “-P” (create parent directories).
tarball (str) – Full path location on HPSS to create the archive.
fileset (list | str) – List containing filenames, patterns, or directories to archive
dereference (bool) – Whether to dereference symbolic links (archive the pointed-to files instead).
- Returns:
output – Concatenated output and error of the htar command.
- Return type:
- cvf(tarball: str, fileset: List | str, dereference: bool = False) str [source]¶
Method to write an archive to HPSS verbosely (without options).
- Parameters:
tarball (str) – Full path location on HPSS to create the archive.
fileset (list | str) – List containing filenames, patterns, or directories to archive
dereference (bool) – Whether to dereference symbolic links (archive the pointed-to files instead).
- Returns:
output – Concatenated output and error from the htar command
- Return type:
- extract(tarball: str, fileset: List | str = [], opts: List | str = '') str [source]¶
Method to extract an archive from HPSS via htar
- Parameters:
opts (str) – String of options to send to htar.
tarball (str) – Full path location of an archive on HPSS to extract from.
fileset (list | str) – Filenames, patterns, or directories to extract from the archive. If empty, then all files will be extracted.
- Returns:
output – Concatenated output and error from the htar command
- Return type:
- tell(tarball: str, opts: List | str = '', fileset: List | str = []) str [source]¶
Method to list the contents of an archive on HPSS
- Parameters:
opts (str) – String of options to send to htar.
tarball (str) – Full path location on HPSS to list the contents of.
fileset (list | str) – Filenames, patterns, or directories to list from the archive. If empty, then all files will be listed.
- Returns:
output – Concatenated output and error from the htar command
- Return type:
- xvf(tarball: str = '', fileset: list = []) str [source]¶
Method to extract an archive from HPSS verbosely (without options).
- Parameters:
tarball (str) – Full path location of an archive on HPSS to extract from.
fileset (list) – List containing filenames, patterns, or directories to extract from the archive. If empty, then all files will be extracted.
- Returns:
output – Concatenated output and error from the htar command
- Return type: