twindb_backup.configuration package¶
Subpackages¶
Submodules¶
twindb_backup.configuration.compression module¶
Compression configuration
-
class
twindb_backup.configuration.compression.
CompressionConfig
(**kwargs)[source]¶ Bases:
object
Compression configuration
- Parameters
program (str) – compression program
threads (int) – number of threads
level (int) – compression level
-
get_modifier
(stream)[source]¶ Build a compression modifier based on the given configuration
- Parameters
stream – stream to compress
- Returns
compression modifier
- Return type
-
property
level
¶ Compression level.
-
property
program
¶ Compression program.
-
property
threads
¶ Number of threads to use.
twindb_backup.configuration.exceptions module¶
TwinDB Backup configuration exceptions.
-
exception
twindb_backup.configuration.exceptions.
ConfigurationError
[source]¶ Bases:
twindb_backup.exceptions.TwinDBBackupError
Base configuration error
twindb_backup.configuration.gpg module¶
GPG configuration
twindb_backup.configuration.mysql module¶
MySQL instance configuration
-
class
twindb_backup.configuration.mysql.
MySQLConfig
(**kwargs)[source]¶ Bases:
object
MySQL Instance configuration
-
property
defaults_file
¶ Path to .my.cnf with MySQL credentials.
-
property
expire_log_days
¶ For how many days keep binlog copies
-
property
full_backup
¶ How often to take full backups e.g.
daily
.
-
property
xbstream_binary
¶ Path to xbstream binary
-
property
xtrabackup_binary
¶ Path to xtrabackup binary
-
property
twindb_backup.configuration.retention module¶
Retention policy configuration
-
class
twindb_backup.configuration.retention.
RetentionPolicy
(hourly, daily, weekly, monthly, yearly)¶ Bases:
tuple
-
property
daily
¶ Alias for field number 1
-
property
hourly
¶ Alias for field number 0
-
property
monthly
¶ Alias for field number 3
-
property
weekly
¶ Alias for field number 2
-
property
yearly
¶ Alias for field number 4
-
property
twindb_backup.configuration.run_intervals module¶
Run policy configuration
-
class
twindb_backup.configuration.run_intervals.
RunIntervals
(hourly, daily, weekly, monthly, yearly)¶ Bases:
tuple
-
property
daily
¶ Alias for field number 1
-
property
hourly
¶ Alias for field number 0
-
property
monthly
¶ Alias for field number 3
-
property
weekly
¶ Alias for field number 2
-
property
yearly
¶ Alias for field number 4
-
property
Module contents¶
Module to process configuration file.
-
class
twindb_backup.configuration.
TwinDBBackupConfig
(config_file='/etc/twindb/twindb-backup.cfg')[source]¶ Bases:
object
Class represents TwinDB Backup configuration
-
property
backup_dirs
¶ Directories to backup
-
property
backup_mysql
¶ FLag to backup MySQL or not
-
property
compression
¶ - Returns
Compression configuration
- Return type
-
destination
(backup_source='build-14005406-project-262906-twindb-backup')[source]¶ - Parameters
backup_source (str) – Hostname of the host where backup is taken from.
- Returns
Backup destination instance
- Return type
-
property
exporter
¶ Read config and return export transport instance
- Returns
Instance of export transport, if it is set
- Return type
- Raise
ConfigurationError, if transport isn’t implemented
-
property
gcs
¶ Google Cloud Storage configuration
-
property
gpg
¶ GPG configuration.
-
property
keep_local_path
¶ If specified a local path where the tool will keep an additional local backup copy.
-
property
mysql
¶ - Returns
Local MySQL source configuration.
- Return type
-
property
retention
¶ - Returns
Remote retention policy.
- Return type
-
property
retention_local
¶ - Returns
Local retention policy.
- Return type
-
property
run_intervals
¶ Run intervals config. When to run or not the backup.
- Returns
Configuration with data on whether to run the backup tool now.
- Return type
-
property
s3
¶ Amazon S3 configuration
-
property