[DEFAULT]
# The following parameter enable or disable an archiver
# Default is to enable all archivers
# can be override per archiver section
# boolean options: yes/no 0/1 true/false
enable=false
# LIMIT applied to delete request
# can be overrided in src section
delete_limit=500
# How many seconds to wait between 2 delete loop
# can be overrided in src section
delete_loop_delay=2
# The LIMIT applied to a select
# can be overrided in src section
select_limit=1000
# Number of statement to stack before commiting
# will take the minimum between select_limit and bulk_insert
bulk_insert=500
# To skip archiving (and only delete because what else) set
# archive_data to false
# can be overrided in src section
archive_data=true
# Set delete_data to true if you want to delete data
# from source backend
# can be overrided in src section
delete_data=false
# The default column name that hold the date of
# soft deleted data
# can be overrided in src section
deleted_column=deleted_at
# The WHERE statement used to select rows to archive/delete
# can be override in src section
# {now}: python interpolation that will set the utcnow sql format date
# ${deleted_column}, ${retention}: options of the config file
where=${deleted_column} <= SUBDATE('{now}', INTERVAL ${retention})
# Set foreign_key_check to false to disable foreign key check
# can be overrided in src section
foreign_key_check=true
# Data lifetime
retention=1 MONTH
# Coma, cariage return or semicolon separated regexp which define databases to
# exclude, the defautl are 'mysql', 'performance_schema', 'information_schema'
excluded_databases=
# Coma, cariage return or semicolon separated regexp which define tables to
# exclude
excluded_tables=shadow_.*
# default file archive format
archive_format=bztar

# Declare an archiver called 'nova'
# Read data from src named 'nova'
# And write data in dst named db_archiver and file_archiver
[archiver:nova]
src=nova
dst=db_archiver, file_archiver
enable=true

# Declare an archiver called 'glance'
# Read data from src named 'nova'
# And write data in dst named db_archiver and file_archiver
# Disable it
[archiver:glance]
src=glance
dst=db_archiver, file_archiver
enable=false

# Here we define the src 'nova'
# Which is a db backend
# We want to archive all the tables of database nova except those defined
# by the regex excluded_tables, data are archived then deleted
[src:nova]
backend=db
host=localhost
port=3307
user=root
password=***********
retention=12 MONTH
databases=nova
tables=*
archive_data=true
delete_data=true

[src:glance]
backend=db
host=localhost
port=3307
user=root
password=***********
retention=12 MONTH
databases=glance
tables=*
excluded_tables=images
archive_data=true
delete_data=true

# db_archiver destination configuration
# backend is a db
# db is suffixed with '_archived'
[dst:db_archiver]
backend=db
host=localhost
port=3307
user=root
password=*********
db_suffix=_archived

# file_archiver destination configuation
# backend is a file
# with 2 formats: csv and sql
[dst:file_archiver]
backend=file
directory=/tmp/archive_{date}
formats=csv,sql
remote_store=swift

[remote_store:swift]
backend=swift
container=osarchiver
# Remote filename is by default of this format:
#    2022-01-12_11:08:19/cinder.volumes.sql.tar.bz2
# With file_name_prefix it will become:
#    <file_name_prefix>/2022-01-12_11:08:19/cinder.volumes.sql.tar.bz2
file_name_prefix=<Ex. region_name>
# All the opt_* key will be available in store_options attribute
# of the remote_store instance, usefull to pass specific options
# to the underlying library which is used to send the data
opt_auth_version=3
opt_os_project_name=project_name
opt_os_username=username
opt_os_password=password
opt_os_auth_url=https://auth.cloud.domain.net/v3
opt_os_region_name=<swift_region_name>
opt_os_project_domain_name=project_domain_name
opt_os_user_domain_name=user_domain_name
# opt_<option_name>=value
# https://docs.openstack.org/python-swiftclient/latest/service-api.html
# opt_retries = 5