Provides the core functionality of the application. Executes an archiver and creates a backup based on provided archive specification file and configuration (IAppConfig). It also allows to read various information about configured and stored archives.
It requires archiver service (IArchiver implementation) for the backup creation.
ArchiverTypes and BackupLevelRestartReasons enums, IArchiving interface and ArchiveInfo class.
Bases: AutoArchive._mainf.iinterface_accessor.IComponentInterface
Provides access to the Archiving component.
Returns names of configured archives from valid only archive specification files passed in specFiles.
Parameters: | specFiles (Iterable<str>) – Paths to archive specification files that shall be validated and from which the names shall be retrieved. |
---|---|
Returns: | Iterable of names of validly configured archives. |
Return type: | Iterable<str> |
Returns information about archive represented by the specFile parameter.
Parameters: | specFile (str) – Path to the archive specification file. |
---|---|
Returns: | Information about an archive or None. |
Return type: | ArchiveInfo |
Returns information about an archive from stored data.
Unlike in the getArchiveInfo() method the information is not read from the archive specification file but from other stored data about the archive created by the component in previous runs. Such data can be fetched for example from application storage (IStorage) or other sources specific to the archiver. It is expected that the large portion of data will be missing in the returned information.
See also: getStoredArchiveNames()
Parameters: | archiveName (str) – Name of the archive which information shall be returned. |
---|---|
Returns: | Information about an archive or None if no data for the archive was found. |
Return type: | ArchiveInfo |
Returns iterable of archive names which has some data stored in a persistent storage.
See also: getStoredArchiveInfo()
Returns: | Iterable of archive names. |
---|---|
Return type: | Iterable<str> |
Creates a backup based on specFile.
Parameters: | specFile (str) – Path to the archive specification file. |
---|---|
Raises ValueError: | |
If the desired archiver type is not supported. |
Deletes all data stored for the archive named archiveName.
See also: getStoredArchiveInfo()
Parameters: | archiveName (str) – Name of the archive which data shall be purged. |
---|---|
Raises: |
|
Bases: builtins.object
Information about an archive.
Note
Class should be instantiated by calling the IArchiving.getArchiveInfo() or IArchiving.getStoredArchiveInfo() factory methods.
Gets the archiver type for this archive.
Note
Value is guaranteed to be non-None.
Return type: | ArchiverTypes |
---|
Gets the current backup level.
Note
Will be None if the archive is not incremental or used archiverType does not support incremental archiving.
Note
For archiver types that supports incremental archiving, whether the return value will be None or not does not depend on the current incremental value. If the archive was configured and created as incremental previously then the backup level will be defined even if the current incremental value would be False and vice versa.
Return type: | int |
---|
Gets the archive’s destination directory.
Note
Value is guaranteed to be non-None.
Return type: | str |
---|
Gets the number of days after which the backup level should be restarted to level 0.
Note
Will be None if the archiverType does not support incremental archiving or if no value is defined for Options.FULL_RESTART_AFTER_AGE.
Return type: | int |
---|
Gets the number of restarts after which the backup level will be restarted to 0.
Note
Will be None if the archiverType does not support incremental archiving or if no value is defined for Options.FULL_RESTART_AFTER_COUNT.
Return type: | int |
---|
Gets the status of incremental archiving activation.
Note
Will be None if the archiverType does not support incremental archiving.
Return type: | bool |
---|
Gets the date when the last backup level restart to level 0 occurred.
Note
Will be None if the archiverType does not support incremental archiving or if restarting was not enabled for the archive in the past.
Return type: | datetime.date |
---|
Gets the date when the last backup level restart occurred.
Note
Will be None if the archiverType does not support incremental archiving or if restarting was not enabled for the archive in the past.
Return type: | datetime.date |
---|
Gets the next backup level.
See also backupLevel.
Note
Will be None if the archive is not incremental or used archiverType does not support incremental archiving.
Return type: | int |
---|
Gets the path to the archive’s root.
Note
Will be None if the archive’s root can not be retrieved.
Return type: | str |
---|
Gets the number of days after which the backup level should be restarted.
Note
Will be None if the archiverType does not support incremental archiving or if no value is defined for Options.RESTART_AFTER_AGE.
Return type: | int |
---|
Gets the maximal backup level; after it is reached it will be restarted to a lower value.
Note
Will be None if the archiverType does not support incremental archiving.
Return type: | int |
---|
Gets the number of backup level restarts already performed.
Note
Will be None if the archiverType does not support incremental archiving or if restarting was not enabled for the archive in the past.
Return type: | int |
---|
Gets a backup level to which a next restart would be done.
Note
Will be None if the archiverType does not support incremental archiving.
Return type: | int |
---|
Gets the reason for the upcoming backup level restart.
Note
Will be None if the archiverType does not support incremental archiving or the restart reason can not be determined.
Return type: | BackupLevelRestartReasons |
---|
Gets the status of backup level restarting activation.
Note
Will be None if the archiverType does not support incremental archiving.
Return type: | bool |
---|
Archiver types.
Reasons for restarting of the backup level.
MIN_COMPRESSION_STRENGTH and MAX_COMPRESSION_STRENGTH constants, BackupTypes, ArchiverFeatures, BackupSubOperations, BackupOperationErrors enums and IArchiver interface and BackupDefinition class.
Bases: builtins.object
SPI for backup creation and management.
Creates a backup.
Parameters: |
|
---|---|
Returns: | Path to the created backup. |
Return type: | str |
Raises: |
|
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: |
|
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, ether 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 |
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. |
Remove a backup.
Backup defined by backupDefinition will be removed.
Parameters: | backupDefinition (BackupDefinition) – Defines backup that shall be removed. BackupDefinition.backupId, BackupDefinition.backupType and BackupDefinition.destination attributes of the passed instance has to be initialized. |
---|---|
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: |
|
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.