MySQL-AutoXtrabackup command-line tool, for automating tedious MySQL physical backups management
Project description
MySQL-AutoXtrabackup
MySQL AutoXtrabackup commandline tool written in Python 3. The source code fully typed with hints - structured the project mostly similar to FastAPI and Pydantic
For community from Azerbaijan MySQL User Community: Python Azerbaijan Community.
For any question please open an issue here.
What this project is about?
The idea for this tool, came from my hard times after accidentally deleting the table data. There was a full backup and 12 incremental backups. It took me 20 minutes to prepare necessary commands for preparing backups. If you have compressed + encrypted backups you need also, decrypt and decompress, which is going to add extra time for preparing backups. Then I decided to automate this process. In other words, preparing necessary commands for backup and prepare stage were automated.
We have nice CLI with necessary options:
autoxtrabackup --help
Usage: autoxtrabackup [OPTIONS]
Options:
--dry-run Enable the dry run.
--prepare Prepare/recover backups.
--run-server Start the FastAPI app for serving API
--backup Take full and incremental backups.
--version Version information.
--defaults-file TEXT Read options from the given file [default: /
home/shako/.autoxtrabackup/autoxtrabackup.cn
f]
--tag TEXT Pass the tag string for each backup
--show-tags Show backup tags and exit
-v, --verbose Be verbose (print to console)
-lf, --log-file TEXT Set log file [default: /home/shako/.autoxtr
abackup/autoxtrabackup.log]
-l, --log, --log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL]
Set log level [default: INFO]
--log-file-max-bytes INTEGER Set log file max size in bytes [default:
1073741824]
--log-file-backup-count INTEGER
Set log file backup count [default: 7]
--help Print help message and exit.
If you think, CLI is not for you. We have experimental feature where you can start API server and take backups using API call(ATTENTION: FastAPI involved)
sudo `which autoxtrabackup` --run-server
INFO: Started server process [30238]
INFO: Waiting for application startup.
app started
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:5555 (Press CTRL+C to quit)
$ curl -X POST http://127.0.0.1:5555/backup
{"result":"Successfully finished the backup process"}
For the rest please read the full documentation.
Development:
Current major version is >= 2.0 - so if you want to help, please do changes on this branch and then kindly send PR :) I also encourage you to upgrade from older version as the code base fully updated. Do you have an idea, question please open an issue.
Read full documentation here:
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
Built Distribution
File details
Details for the file mysql_autoxtrabackup-2.0.2.tar.gz
.
File metadata
- Download URL: mysql_autoxtrabackup-2.0.2.tar.gz
- Upload date:
- Size: 102.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.23.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29c22c136b37520262cd238598ea6c0a1e5fd57c6cf62c5fda01f0c3afc5fe17 |
|
MD5 | 19933239adbce3dc6be8bcc0fe2c05df |
|
BLAKE2b-256 | 9a7b6cf06617866f49e29773d63c22d9013ec3809e7744cad7c9f32752db02fd |
File details
Details for the file mysql_autoxtrabackup-2.0.2-py3-none-any.whl
.
File metadata
- Download URL: mysql_autoxtrabackup-2.0.2-py3-none-any.whl
- Upload date:
- Size: 36.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.23.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fc5cf5494a8d6531e9593feee6c836ec26324114283e30eaed3979cd7577ca8 |
|
MD5 | 82a005b8a416b0b13df81d20fd3ffed7 |
|
BLAKE2b-256 | 3663855741cf1d3c78756ad07bc82a9cdf661f7234aff83eb06ba72ed0932e74 |