Provides services for creating the backup.
ArchiverServiceIdentification interface.
Bases: AutoArchive._infrastructure.service.iservice_identification.IServiceIdentification
Identifies the Archiver service.
Parameters required by the service upon creation:
workDir: Path to a writable directory. The service will use it as persistent storage (type str).
ArchiverServiceProviderIDs enum.
Implementations of the archiver service.
MIN_COMPRESSION_STRENGTH and MAX_COMPRESSION_STRENGTH constants, BackupTypes, ArchiverFeatures, BackupSubOperations, BackupOperationErrors enums and BackupDefinition class.
Bases: builtins.object
Container class for information needed to create a backup.
Type of the backup.
Return type: | BackupTypes |
---|
Minimal compression strength value.
Maximal compression strength value.
Backup types.
Features that archiver service may support.
Operations executed during backup creation.
Errors that may occur during backup operation.
Bases: AutoArchive._infrastructure.service.iservice_component.IServiceComponent
Service component for archiver services.
Registers service identified by ArchiverServiceIdentification with two providers of _TarArchiverProviderIdentification-like interface.
Bases: AutoArchive._infrastructure.service.iservice_component.IServiceComponent
Service component for archiver services.
Registers service identified by ArchiverServiceIdentification with two providers of _TarArchiverProviderIdentification-like interface.
See: IServiceComponent.destroyServices()
_TarArchiverProviderIdentification.
Bases: builtins.object
Provides information about services defined in ArchiverServiceProviderIDs.
Parameters: | serviceProviderId (ArchiverServiceProviderIDs.) – Identifier of the service that this instance shall provide information for. |
---|
_TarArchiverProviderBase class.
Bases: AutoArchive._infrastructure.service.iservice.IService
Base class for tar archiver service providers.
Abstract constructor of this class, should be called from derived constructors. It initializes the workDir_ property.
Parameters: | workDir (str) – Path to a writable directory. The service will use it as persistent storage. |
---|
Creates a backup.
Parameters: |
|
---|---|
Returns: | Path to the created backup. |
Return type: | str |
Raises: |
|
Performs basic checks before the backup creation.
Note
Derived classes should call this base method on the beginning of the overridden method.
Creates an incremental backup.
A backup of specified level or the next level in a row will be created. The maximal backup level will be increased (see getMaxBackupLevel()).
Parameters: |
|
---|---|
Returns: | Path to the created backup. |
Return type: | str |
Raises: |
|
Performs basic checks before the incremental backup creation.
Note
Derived classes should call this base method on the beginning of the overridden method.
Returns True, if one or more backup levels of a backup defined by backupDefinition exists.
Parameters: |
|
---|---|
Returns: | True if any backup level exists, False otherwise. |
Return type: | bool |
Raises ValueError: | |
If backupDefinition.backupType is not supported by the implementation. |
Returns True, if backup exists.
Parameters: |
|
---|---|
Returns: | True if the backup exists, False otherwise. |
Return type: | bool |
Raises ValueError: | |
If backupDefinition.backupType is not supported by the implementation. |
Assembles the backup file name and returns a path to it.
Parameters: |
|
---|---|
Returns: | Path to the backup file. |
Return type: | str |
Determines and returns maximal backup level that can be created.
Parameters: | backupId (str) – ID of the backup for which the level shall be determined. |
---|---|
Returns: | The maximal backup level that can be created by backupFilesIncrementally(). |
Return type: | int |
Raises: |
|
Returns iterable of archive IDs which has some data stored in a persistent storage.
See also: purgeStoredBackupData().
Returns: | Iterable of archive names. |
---|---|
Return type: | Iterable<str> |
Raises OSError: | If a system error occurred. |
Returns a set of supported features, either all of them or for given backupType.
Parameters: | backupType (BackupTypes) – The backup type for which the features shall be returned or None if all supported features shall be returned. |
---|---|
Returns: | Supported features for given backupType or all supported features. |
Return type: | set<ArchiverFeatures> |
Raises ValueError: | |
If the given backupType is not supported by this service |
Keeps a backup with keepingId under the newKeepingId.
See also: doesBackupExist() or doesAnyBackupLevelExist().
Parameters: |
|
---|---|
Raises: |
|
Removes internal data from a persistent storage for the passed backupId.
See also: getStoredBackupIds().
Parameters: | backupId (str) – ID of the backup of which data shall be purged. |
---|---|
Raises OSError: | If a system error occurred. |
Raises an exception if the passed backupType is not supported by the implementation.
See also: _TarArchiverProviderBase.supportedBackupTypes.
Parameters: | backupType (BackupTypes) – The backup type that shall be checked. |
---|---|
Raises ValueError: | |
If the passed backupType is not supported by the concrete implementation. |
Remove a backup.
Backup defined by backupDefinition will be removed.
Parameters: |
|
---|---|
Raises: |
|
Remove backup increments starting from level.
Backups (increments) of backup level higher or equal than level or higher that the current backup level - in case level is None - will be removed. The maximal backup level (getMaxBackupLevel()) will be set to the value level.
Parameters: |
|
---|---|
Raises: |
|
_ExternalTarArchiverProvider class.
Bases: AutoArchive._services.archiver._tar_archiver_provider_base._TarArchiverProviderBase
External archiver service provider.
See also: _TarArchiverProviderBase.
Raises OSError: | If creation of the snapshot directory failed. |
---|
_InternalTarArchiverProvider class.
Bases: AutoArchive._services.archiver._tar_archiver_provider_base._TarArchiverProviderBase
Internal archiver service provider.
See also: _TarArchiverProviderBase.