vps_backup_utils
Backup Utilities for Linux VPS with MySQL and other data.
With this package, you can write Python scripts to call cli tools. (need to install cli tools in advance)
Supported cli
-
mysqldump -
pg_dump -
tar -
gzip -
rsync(to remote servers)
Usage
- Run
pip install vps_backup_utilson your VPS - Write a Python script like the below one, and save on your VPS
- Add this script to your VPS's crontab
#!/usr/bin/env python
from vps_backup_utils import VPSBackupUtils
backuper = VPSBackupUtils('~/backup')
backuper.remove_old_backups(30)
backuper.mysqldump_backup(
backup_prefix='project1',
host='127.0.0.1',
port='3306',
user='root',
password='password',
databases=None,
gzipped=True
)
backuper.tar_backup(
backup_prefix='project1',
src_folder='/path/to/project1/data'
)
backuper.mysqldump_backup(
backup_prefix='another_project',
host='127.0.0.1',
port='3307',
user='root',
password='password',
databases=None,
gzipped=True
)
backuper.rsync_backups_to_remote(
host='another.server',
user='user',
remote_backup_path='~/server1-backup',
port='22222',
delete_mode=True
)
develop
install dependencies
pip3 install poetry
poetry install
test on host machine
Write your codes to main.py, and just run.
python3 main.py
run unit tests on host machine (not recommended)
poetry run pytest
run unit tests on docker (recommended)
docker-compose up -d mysql postgresql
docker-compose up pytest --build
build & publish
poetry update && poetry build && poetry publish
Metadata
Release files for vps-backup-utils 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| vps_backup_utils-0.0.3.tar.gz | 5.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vps_backup_utils-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.1 kB
Release files / vps_backup_utils-0.0.3.tar.gz
| Download URL | vps_backup_utils-0.0.3.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a189acee3113a48d047393e154baaf09a1219826ae54d410e602e34fa079da9
|
|
BLAKE2b-256 checksum How to use checksums |
c3afb0f010939d11138ec602cd76967a38d8d516406125889a4896fcaaf8a1fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.10.2 Linux/5.14.21-2-MANJARO
|
Release files / vps_backup_utils-0.0.3-py3-none-any.whl
| Download URL | vps_backup_utils-0.0.3-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
826349dffee5082d1ab77c34366e567d84d09c39ebbdaa2751de36df5f09bb48
|
|
BLAKE2b-256 checksum How to use checksums |
86483dfb8194c099e5fd60f4777b8ecb3c9fbe51b663bff7467e13f662c8d449
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.10.2 Linux/5.14.21-2-MANJARO
|
Security for vps-backup-utils 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.