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

Function files_cache_name

src/borg/cache.py:43–57  ·  view source on GitHub ↗

Return the name of the files cache file for the given archive name. :param archive_name: name of the archive (ideally a series name) :param files_cache_name: base name of the files cache file :return: name of the files cache file

(archive_name, files_cache_name="files")

Source from the content-addressed store, hash-verified

41
42
43def files_cache_name(archive_name, files_cache_name="files"):
44 """
45 Return the name of the files cache file for the given archive name.
46
47 :param archive_name: name of the archive (ideally a series name)
48 :param files_cache_name: base name of the files cache file
49 :return: name of the files cache file
50 """
51 suffix = os.environ.get("BORG_FILES_CACHE_SUFFIX", "")
52 # when using archive series, we automatically make up a separate cache file per series.
53 # when not, the user may manually do that by using the env var.
54 if not suffix:
55 # avoid issues with too complex or long archive_name by hashing it:
56 suffix = xxh64(archive_name.encode()).hexdigest()
57 return files_cache_name + "." + suffix
58
59
60def discover_files_cache_names(path, files_cache_name="files"):

Callers 3

files_cache_nameMethod · 0.85
cleanup_files_cacheMethod · 0.85

Calls 2

hexdigestMethod · 0.80
getMethod · 0.45

Tested by 1