Backup tool for PowerDNS database
Project description
What is this?
Backup tool for PowerDNS database (MySQL) to local or S3 storage in bind format. Open metrics are also computed on your feched zones.
PyPI
Deploy the pdnsbackup
tool in your server with the pip command.
pip install pdnsbackup
After installation, you can execute the pdnsbackup
to start-it.
Docker run
sudo docker run --rm --env-file ./.env --name=pdnsbackup dmachard/pdnsbackup:latest
Configuration
This tool can be configurated with severals ways. See the default config file:
-
from external configuration file (
-c config
argument) -
from environment variables
Variables | Description |
---|---|
PDNSBACKUP_DEBUG | debug mode 1 or 0 |
PDNSBACKUP_GMYSQL_ENABLED | set to 1 to enable gmysql backend, enabled by default |
PDNSBACKUP_GMYSQL_HOST | mysql port, default is 127.0.0.1 |
PDNSBACKUP_GMYSQL_PORT | mysql port, default is 3306 |
PDNSBACKUP_GMYSQL_SSL | enable ssl, default is 0 |
PDNSBACKUP_GMYSQL_DBNAME | mysql database name |
PDNSBACKUP_GMYSQL_USER | mysql user |
PDNSBACKUP_GMYSQL_PASSWORD | mysql password |
PDNSBACKUP_FILE_ENABLED | set to 1 enable backup to file, enabled by default |
PDNSBACKUP_FILE_PATH_BIND | zone bind path |
PDNSBACKUP_FILE_PATH_OUTPUT | output folder |
PDNSBACKUP_S3_ENABLED | set to 1 enable backup to S3 storage, disabled by default |
PDNSBACKUP_S3_ENDPOINT_URL | your s3 url |
PDNSBACKUP_S3_SSL_VERIFY | disable ssl verify |
PDNSBACKUP_S3_ACCESS_KEY_ID | your access key |
PDNSBACKUP_S3_SECRET_ACCESS_KEY | your secret access key |
PDNSBACKUP_S3_BUCKET_NAME | bucket name |
PDNSBACKUP_S3_BACKUP_FILE | backup file name |
PDNSBACKUP_S3_BACKUP_DELETE_OLDER | delete backups older than xx days |
PDNSBACKUP_METRICS_ENABLED | export open metrics |
PDNSBACKUP_METRICS_PROM_FILE | write metrics to file path |
Run from source
Create a .env
file to populate your variable
Create a virtualenv
python -m venv venv
source venv/bin/activate
Install requirements and run-it
python3 -m pip install -r requirements.txt
python3 -c "import pdnsbackup; pdnsbackup.run();"
python3 -c "import pdnsbackup; pdnsbackup.run();" -c tests/config.yml
Build and run from docker image
sudo docker build . --file Dockerfile -t pdnsbackup
Run tests
Run all tests
python -m unittest discover -v tests/
Run one by one
python -m unittest -v tests.test_config
python -m unittest -v tests.test_parser
python -m unittest -v tests.test_import
python -m unittest -v tests.test_export_file
python -m unittest -v tests.test_export_metrics
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pdnsbackup-0.6.0.tar.gz
(12.1 kB
view hashes)
Built Distribution
Close
Hashes for pdnsbackup-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 275069db60e89357f7792d369d6ab28d511dce653125870158f8825a1df6916d |
|
MD5 | c7b808d04e9a19ec31f111d0693dd8d5 |
|
BLAKE2b-256 | 5ca70599d7edbcddd87d464756eb93372311c1a66e381b24dec2534942a4a137 |