MCPcopy
hub / github.com/borgbackup/borg / Archive

Class Archive

src/borg/archive.py:472–1108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470
471
472class Archive:
473 class AlreadyExists(Error):
474 """Archive {} already exists"""
475
476 exit_mcode = 30
477
478 class DoesNotExist(Error):
479 """Archive {} does not exist"""
480
481 exit_mcode = 31
482
483 class IncompatibleFilesystemEncodingError(Error):
484 """Failed to encode filename "{}" into file system encoding "{}". Consider configuring the LANG environment variable."""
485
486 exit_mcode = 32
487
488 def __init__(
489 self,
490 manifest,
491 name,
492 *,
493 cache=None,
494 create=False,
495 numeric_ids=False,
496 noatime=False,
497 noctime=False,
498 noflags=False,
499 noacls=False,
500 noxattrs=False,
501 progress=False,
502 chunker_params=CHUNKER_PARAMS,
503 timestamp=None,
504 start=None,
505 end=None,
506 log_json=False,
507 iec=False,
508 deleted=False,
509 hostname=None,
510 username=None,
511 ):
512 name_is_id = isinstance(name, bytes)
513 if not name_is_id:
514 assert len(name) <= 255
515 self.cwd = os.getcwd()
516 assert isinstance(manifest, Manifest)
517 self.manifest = manifest
518 self.key = manifest.repo_objs.key
519 self.repo_objs = manifest.repo_objs
520 self.repository = manifest.repository
521 self.cache = cache
522 self.stats = Statistics(output_json=log_json, iec=iec)
523 self.iec = iec
524 self.show_progress = progress
525 self.name = name # overwritten later with name from archive metadata
526 self.name_in_manifest = name # can differ from .name later (if borg check fixed duplicate archive names)
527 self.comment = None
528 self.tags = None
529 self.hostname = hostname if hostname is not None else platform.hostname

Callers 15

_build_files_cacheMethod · 0.85
_process_archiveMethod · 0.85
create_target_archiveMethod · 0.85
open_archiveMethod · 0.85
_process_archiveMethod · 0.85
archiveMethod · 0.85
analyze_archivesMethod · 0.85
do_diffMethod · 0.85
do_infoMethod · 0.85
do_createMethod · 0.85
_list_innerMethod · 0.85
do_tagMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_timestamp_parsingFunction · 0.68