AutoArchive._application.archiving._archiver_manipulator¶
ArchiverManipulator and its helper classes.
Modules¶
archiver_manipulator¶
- class AutoArchive._application.archiving._archiver_manipulator.archiver_manipulator.ArchiverManipulator(backupInformationProvider, componentUi, storage, serviceAccessor: ServiceAccessor)[source]¶
Bases:
objectPerforms actions with backups.
Uses
TarArchiverProviderBase-like services to manipulate with or create backups.Note
backupInformationProvideris not updated by this class.- Parameters:
backupInformationProvider – Represents the archive that this instance shall be manipulating with.
componentUi (
CmdlineUi) – Access to user interface.storage (
FileStorage) – Application storage.serviceAccessor (
ServiceAccessor) – Access to services.
- Raises:
RuntimeError – If the archiver service could not be created.
- static tryPurgeStoredArchiveData(archiveName, storage, serviceAccessor)[source]¶
Deletes all data stored for the archive named
archiveNameif any.See also:
_BackupInformationProvider.getStoredArchiveNames()- Parameters:
archiveName (
str) – Name of the archive which data shall be purged.storage (
IStorage) – The application storage.serviceAccessor (
IServiceAccessor) – Service accessor.
- Returns:
Trueif data was purged;Falseotherwise.- Return type:
bool- Raises:
RuntimeError – If the archiver service could not be created.
OSError – If an error occurred during the operation of removing data from a physical storage.
- createBackup()[source]¶
Runs the archiver and creates a backup.
- Returns:
Path to the created backup.
- Return type:
str- Raises:
RuntimeError – If the backup operation was aborted due to a fatal error.
OSError – If a system error occurred while making the backup.
- isOptionSupported(option)[source]¶
Returns
Trueif the passedoptionis supported by the current configuration of this instance.Whether an option is supported or not depends on the archiver type set in the archive specification file that is currently attached.
- Parameters:
option (
Option) – The option which shall be tested for support.- Returns:
Trueif the passedoptionis supported;Falseotherwise.- Return type:
bool
_backup_keeping_manipulations¶
_BackupKeepingManipulations class.
- class AutoArchive._application.archiving._archiver_manipulator._backup_keeping_manipulations._BackupKeepingManipulations(archiveSpec, componentUi, archiverService)[source]¶
Bases:
objectOperations for keeping old backups.
- Parameters:
archiveSpec (
ArchiveSpec) – Archive specification of the backup that this instance will operate on.componentUi (
CmdlineUi) – Component UI instance.archiverService (
TarArchiverProviderBase) – Archiver service to use for operations with the backup.
- keepOldBackups(backupDefinition)[source]¶
Keeps old backups according configuration settings.
- Parameters:
backupDefinition (
BackupDefinition) – Provides information about backup which shall be kept. It has to be populated from the sameArchiveSpecinstance as passed to the constructor.
- keepOldIncrementalBackups(backupDefinition, fromLevel)[source]¶
Keeps old incremental backups according configuration settings.
- Parameters:
backupDefinition (
BackupDefinition) – Provides information about backup which shall be kept. It has to be populated from the sameArchiveSpecinstance as passed to the constructor.
_keeping_id_operations¶
_KeepingIdOperations class.