twindb_backup.copy package¶
Submodules¶
twindb_backup.copy.base_copy module¶
Base class for a backup copy
- class twindb_backup.copy.base_copy.BaseCopy(host, name)[source]¶
Bases:
object
Base class for a backup copy in status
- Parameters
host (str) – Hostname where the backup was taken from.
name (str) – Base name of the backup copy file as it’s stored on the destination.
- property key¶
It’s a relative path backup copy. It’s relative to the remote path as from the twindb config. It’s also a key in status, hence the name.
- Returns
Path to file
- Return type
str
- Raises
UnknownSourceType – If source type is not defined
twindb_backup.copy.binlog_copy module¶
Class to describe Binlog backup copy
- class twindb_backup.copy.binlog_copy.BinlogCopy(host, name, created_at)[source]¶
Bases:
twindb_backup.copy.base_copy.BaseCopy
Instantiate a Binlog copy in status
- Parameters
host (str) – Hostname where the backup was taken from.
name (str) – Base name of the backup copy file as it’s stored on the destination.
created_at (int) – Time when copy created
- property created_at¶
Time of created copy
- property name¶
Binlog copy name as in SHOW BINARY LOGS.
twindb_backup.copy.exceptions module¶
Module for Backup copy exception classes.
- exception twindb_backup.copy.exceptions.BackupCopyError[source]¶
Bases:
twindb_backup.exceptions.TwinDBBackupError
General backup copy error
- exception twindb_backup.copy.exceptions.UnknownSourceType[source]¶
Bases:
twindb_backup.copy.exceptions.BackupCopyError
Raises when source type is not set
- exception twindb_backup.copy.exceptions.WrongInputData[source]¶
Bases:
twindb_backup.copy.exceptions.BackupCopyError
Raises when incorrent inputs are used
twindb_backup.copy.file_copy module¶
This module describes class to work with backup copies of the file type.
- class twindb_backup.copy.file_copy.FileCopy(*args, **kwargs)[source]¶
Bases:
twindb_backup.copy.periodic_copy.PeriodicCopy
Backup copy of a file or directory.
- Parameters
host (str) – hostname where the backup was taken from.
name (str) – backup copy basename
run_type (str) – run type. daily, hourly, etc.
twindb_backup.copy.mysql_copy module¶
Class to describe MySQL backup copy
- class twindb_backup.copy.mysql_copy.MySQLCopy(*args, **kwargs)[source]¶
Bases:
twindb_backup.copy.periodic_copy.PeriodicCopy
Instantiate a MySQL copy.
- Parameters
host (str) – Hostname where the backup was taken from.
run_type (str) – Run type when the backup was taken: daily, weekly, etc.
name (str) – Base name of the backup copy file as it’s stored on the destination.
- Raises
WrongInputData – if type is neither full or incremental, if name is not a basename.
- property backup_finished¶
Timestamp when the backup job finished.
- property backup_started¶
Timestamp when the backup job started.
- property binlog¶
File name of the binlog.
- property config¶
Dictionary of configs and their content.
- property created_at¶
Timestamp when the backup job started.
- property duration¶
Time in seconds it took to take the backup.
- property galera¶
True if the backup was taken from Galera.
- property lsn¶
LSN of the backup.
- property parent¶
For incremental backup it is a base full copy name.
- property position¶
Binlog position of the backup copy.
- property server_vendor¶
- property sort_key¶
- property type¶
Full or incremental.
- property wsrep_provider_version¶
If it was Galera, value of wsrep_provider_version
- property xbstream_binary¶
- property xtrabackup_binary¶
twindb_backup.copy.periodic_copy module¶
Interval class for a backup copy
- class twindb_backup.copy.periodic_copy.PeriodicCopy(*args, **kwargs)[source]¶
Bases:
twindb_backup.copy.base_copy.BaseCopy
Interval class for a periodic backup copy in status
- Parameters
host (str) – Hostname where the backup was taken from.
run_type (str) – Run type when the backup was taken: daily, weekly, etc.
name (str) – Base name of the backup copy file as it’s stored on the destination.
- property host¶
Host where the backup was taken
- property name¶
Name of the backup. It’s basename w/o directory part.
- property run_type¶
What run type was when the backup copy was taken.