pyslk.archive

Contents

pyslk.archive#

pyslk.archive(resource, dst_gns, recursive=False, retry=False, **kwargs) tuple[list, str]#

Upload data to tape archive using slk archive

This archiving function wraps some functionalities around archive_raw(). It returns a list of archived files or directories and can use tenacity for retrying failed archive attempts.

Parameters:
  • resource (str or list) – Path, pattern or list of files that should be archived.

  • dst_gns (str) – Destination directory for archiving.

  • recursive (bool) – Archive recursively.

  • retry (bool) – Retry archiving if an ArchiveError is encountered. If retry is True and archiving fails due to ArchiveError, archiving will wait for 10 seconds and retry. Maximal 3 attempts are made. After that, ArchiveError will be raised after all. Requires tenacity to be installed.

Returns:

a tuple containing archived files and stdout from archive_raw.

Return type:

(list, str)

See also