twindb_backup.configuration package

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:Modifier
level

Compression level.

program

Compression program.

threads

Number of threads to use.

twindb_backup.configuration.exceptions module

TwinDB Backup configuration exceptions

exception twindb_backup.configuration.exceptions.ConfigurationError[source]

Bases: exceptions.Exception

Base configuration error

twindb_backup.configuration.gpg module

GPG configuration

class twindb_backup.configuration.gpg.GPGConfig(**kwargs)[source]

Bases: object

GPG configuration

keyring

Path to keyring.

recipient

E-mail address of the message recipient.

secret_keyring

Path to secret keyring.

twindb_backup.configuration.mysql module

MySQL instance configuration

class twindb_backup.configuration.mysql.MySQLConfig(**kwargs)[source]

Bases: object

MySQL Instance configuration

defaults_file

Path to .my.cnf with MySQL credentials.

expire_log_days

For how many days keep binlog copies

full_backup

How often to take full backups e.g. daily.

xbstream_binary

Path to xbstream binary

xtrabackup_binary

Path to xtrabackup binary

twindb_backup.configuration.retention module

Retention policy configuration

class twindb_backup.configuration.retention.RetentionPolicy(hourly, daily, weekly, monthly, yearly)

Bases: tuple

daily

Alias for field number 1

hourly

Alias for field number 0

monthly

Alias for field number 3

weekly

Alias for field number 2

yearly

Alias for field number 4

twindb_backup.configuration.run_intervals module

Run policy configuration

class twindb_backup.configuration.run_intervals.RunIntervals(hourly, daily, weekly, monthly, yearly)

Bases: tuple

daily

Alias for field number 1

hourly

Alias for field number 0

monthly

Alias for field number 3

weekly

Alias for field number 2

yearly

Alias for field number 4

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

backup_dirs

Directories to backup

backup_mysql

FLag to backup MySQL or not

compression
Returns:Compression configuration
Return type:CompressionConfig
destination(backup_source='build-9963184-project-262906-twindb-backup')[source]
Parameters:backup_source (str) – Hostname of the host where backup is taken from.
Returns:Backup destination instance
Return type:BaseDestination
exporter

Read config and return export transport instance

Returns:Instance of export transport, if it is set
Return type:BaseExporter
Raise:ConfigurationError, if transport isn’t implemented
gcs

Google Cloud Storage configuration

gpg

GPG configuration.

keep_local_path

If specified a local path where the tool will keep an additional local backup copy.

mysql
Returns:Local MySQL source configuration.
Return type:MySQLConfig
retention
Returns:Remote retention policy.
Return type:RetentionPolicy
retention_local
Returns:Local retention policy.
Return type:RetentionPolicy
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:RunIntervals
s3

Amazon S3 configuration

ssh
Returns:Remote SSH configuration.
Return type:SSHConfig