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
orlist
) – 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 anArchiveError
is encountered. Ifretry
is True and archiving fails due toArchiveError
, archiving will wait for 10 seconds and retry. Maximal 3 attempts are made. After that,ArchiveError
will be raised after all. Requirestenacity
to be installed.
- Returns:
a tuple containing archived files and stdout from archive_raw.
- Return type:
(list, str)
See also