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

Modifier

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

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

Bases: object

GPG configuration

property keyring

Path to keyring.

property recipient

E-mail address of the message recipient.

property 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

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

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

property backup_dirs

Directories to backup

property backup_mysql

FLag to backup MySQL or not

property compression
Returns

Compression configuration

Return type

CompressionConfig

destination(backup_source='build-22121957-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

property 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

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

MySQLConfig

property retention
Returns

Remote retention policy.

Return type

RetentionPolicy

property retention_local
Returns

Local retention policy.

Return type

RetentionPolicy

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

RunIntervals

property s3

Amazon S3 configuration

property ssh
Returns

Remote SSH configuration.

Return type

SSHConfig

property tar_options
Returns

Additional options passed to tar.

Return type

str