AutoArchive._services.archiver._external_tar_archiver_provider — AutoArchive Developer Manual (ver. 2.1.0.dev20260309)

# AutoArchive._services.archiver._external_tar_archiver_provider

## Modules

### external_tar_archiver_provider

class AutoArchive._services.archiver._external_tar_archiver_provider.external_tar_archiver_provider.ExternalTarArchiverProvider(workDir)

  Bases: `TarArchiverProviderBase`

  External archiver service provider.

  See also: `TarArchiverProviderBase`.

  Raises:

    OSError – If creation of the snapshot directory failed.

  classmethod getSupportedFeatures(backupType=None)

    See: `TarArchiverProviderBase.getSupportedFeatures()`.

  backupFiles(backupDefinition, compressionStrength=None, overwriteAtStart=False)

    See: `TarArchiverProviderBase.backupFiles()`.

  backupFilesIncrementally(backupDefinition, compressionStrength=None, level=None, overwriteAtStart=False)

    See: `TarArchiverProviderBase.backupFilesIncrementally()`.

  doesAnyBackupLevelExist(backupDefinition, fromLevel=0, keepingId=None)

    See: `TarArchiverProviderBase.doesAnyBackupLevelExist()`.

  getMaxBackupLevel(backupId)

    See: `TarArchiverProviderBase.getMaxBackupLevel()`.

  getStoredBackupIds()

    See: `TarArchiverProviderBase.getStoredBackupIds()`.

  isBackupTypeAvailable_(backupType: Tar, TarGz, TarBz2, TarXz, TarZst) → bool

    Returns `True` if passed `backupType` is available.

    A backup type is available if it can be used for backup creation. Usually it means that all required dependencies are installed in the system.

  purgeStoredBackupData(backupId)

    See: `TarArchiverProviderBase.purgeStoredBackupData()`.

  removeBackupIncrements(backupDefinition, level=None, keepingId=None)

    See: `TarArchiverProviderBase.removeBackupIncrements()`.

  supportedBackupTypes = frozenset({0, 1, 2, 3, 4})

### _external_tar_incremental_utility

class AutoArchive._services.archiver._external_tar_archiver_provider._external_tar_incremental_utility._ExternalTarIncrementalUtility(backupId, workDir)

  Bases: `object`

  Utility class for GNU tar incremental backup operations.

  classmethod getSnapshotsDir(workDir)
  classmethod getSnapshotsForBackup(snapshotsDir, backupId='')

    Returns sequence of snapshot file names for the archive named `backupId` or all of them.

    Parameters:

      - snapshotsDir (`str`) – Directory where the snapshot files are stored. Can be obtained with `getSnapshotsDir()` method.

      - backupId (`str`) – Name of the archive for which the snapshot file names shall be returned. If not specified all snapshot files will be returned.

    Returns:

      Sequence of snapshot file names.

    Return type:

      `Sequence<str>`

    Raises:

      OSError – If `snapshotsDir` does not exist or is not accessible. The exception contains two parameters: the error message and the name of the directory.

  classmethod makeSnapshotsDir(workDir)

    Creates the snapshots directory.

    Raises:

      OSError – If creation of the directory was not successful.

  static getLevelFromFileName(fileName, keptBackup=False)

    Extracts backup level number from the file name.

    Parameters:

      fileName (`str`) – Name of the file used to get the backup level from. It should be in the form: ‘<archive_name>[.<level>].<suffix>’.

    Returns:

      The backup level retrieved from the file name.

    Return type:

      `int`

  createWorkingSnapshotFile(level)

    Copies snapshot file for `level` to a temporary file.

  getMaxBackupLevel()

    Returns maximal backup level that is possible to create.

    Raises:

      OSError – If a system error occurred.

  getSnapshotFileName(level, keepingId=None)

    Returns full path to snapshot file for a certain backup level.

  getSnapshots()

    Returns sequence of snapshot file names for current backup.

  manageSnapshotFiles(level, latestLevelSnapshotFilePath)

    Moves snapshot file to its proper location and name in order to preserve it and removes redundant ones.

    Raises:

      OSError – If a system error occurred.

  removeSnapshotFiles(level)

    Remove snapshot files for levels higher or equal to `level`.

  tryRemoveSnapshotFile(level, keepingId=None)

    Removes snapshot file for given backup level if it exists.

    Parameters:

      - level (`int`) – Backup level for which the snapshot file shall be removed.

      - keepingId (`str`) – If not `None` a kept snapshot with this ID will be removed.

    Returns:

      `True` if the snapshot file was removed; `False` if the file does not exists.

    Raises:

      OSError – If a system error occurred.