Skip to main content

Interactive backup and restore CLI for PostgreSQL, MariaDB, and MSSQL.

Project description

fuelrod-backup

Interactive backup and restore CLI for PostgreSQL, MariaDB/MySQL, and Microsoft SQL Server.

Features

  • Supports postgres, mariadb, and mssql engines
  • Interactive backup and restore wizards
  • Non-interactive backup mode for automation
  • Docker and direct-host connection modes
  • Config bootstrap wizard (init) and connection check (test)
  • Backup retention cleanup (KEEP_DAYS)

Installation

pip install fuelrod-backup

Or with pipx:

pipx install fuelrod-backup

Quick Start

  1. Initialize config:
fuelrod-backup init
  1. Validate connection:
fuelrod-backup test
  1. Run backup:
fuelrod-backup backup
  1. Run restore:
fuelrod-backup restore

Documentation

CLI Commands

fuelrod-backup backup [OPTIONS]
fuelrod-backup restore [OPTIONS]
fuelrod-backup test [OPTIONS]
fuelrod-backup init [OPTIONS]

backup options

  • --no-interactive, -n skip prompts and back up all databases
  • --compress / --no-compress override compression
  • --keep-days, -k override retention days (0 keeps forever)
  • --db, -d repeatable database selector
  • --docker / --no-docker override USE_DOCKER
  • --db-type, -t one of postgres | mariadb | mssql
  • --config, -c explicit config file path

restore and test options

  • --docker / --no-docker
  • --db-type, -t
  • --config, -c

init options

  • --output, -o output path for generated config (default .backup)

Config

Config is loaded in this order:

  1. defaults in code
  2. config file (--config if passed, otherwise auto-discovered)
  3. environment variables (highest priority)

Auto-discovery order

For each directory below, files are checked in this order:

  1. .backup
  2. .env
  3. .env-backup

Directories searched:

  1. current working directory
  2. project directory
  3. parent repo directory

Main keys

  • DB_TYPE=postgres|mariadb|mssql
  • DB_USERNAME, DB_PASSWORD, DB_HOST, DB_PORT
  • USE_DOCKER=true|false
  • SERVICE=<container-name>
  • BASE_DIR=<backup-root>
  • COMPRESS_FILE=true|false
  • KEEP_DAYS=<int>
  • CONNECTION_TIMEOUT=<seconds>

PostgreSQL-specific:

  • PG_DUMP_CMD
  • PG_RESTORE_CMD

MariaDB-specific:

  • MYSQL_DUMP_CMD
  • MYSQL_CMD

MSSQL-specific:

  • MSSQL_BACKUP_DIR

Notes

  • Effective backup output directory is <BASE_DIR>/<DB_TYPE>/....
  • PostgreSQL backups use custom format .dump (optional .gz).
  • MariaDB backups use .sql (optional .gz or .zip input supported on restore).
  • MSSQL backups use .bak.

License

GNU General Public License v3.0 or later. See LICENSE.

Breaking Change

Connection variables are now engine-agnostic only:

  • DB_USERNAME
  • DB_PASSWORD
  • DB_HOST
  • DB_PORT

Legacy connection keys (PG_USERNAME, PG_PASSWORD, PG_HOST, PG_PORT) are no longer loaded.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fuelrod_backup-2.1.3.tar.gz (49.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fuelrod_backup-2.1.3-py3-none-any.whl (59.6 kB view details)

Uploaded Python 3

File details

Details for the file fuelrod_backup-2.1.3.tar.gz.

File metadata

  • Download URL: fuelrod_backup-2.1.3.tar.gz
  • Upload date:
  • Size: 49.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.3 CPython/3.14.3 Linux/6.17.0-1008-azure

File hashes

Hashes for fuelrod_backup-2.1.3.tar.gz
Algorithm Hash digest
SHA256 54f685ff1ae4a6111af65e1ad51e6846cae5ae1e78948f125cffab1dd8b74b21
MD5 c4f26ed504fba0bfc39ccf4e050f3c61
BLAKE2b-256 1f5db51499c9b01b8530ddce4528f90c250b9e0b6469b1b619a9ffd2abe09248

See more details on using hashes here.

File details

Details for the file fuelrod_backup-2.1.3-py3-none-any.whl.

File metadata

  • Download URL: fuelrod_backup-2.1.3-py3-none-any.whl
  • Upload date:
  • Size: 59.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.3 CPython/3.14.3 Linux/6.17.0-1008-azure

File hashes

Hashes for fuelrod_backup-2.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 94c4ebfd8c52d1a4863b81dcf0805707728c423ccab5020c4ded9c40b1eee930
MD5 5d3eebca4d69c5e45313eaa3aaacf28e
BLAKE2b-256 99941816df2e4de36f5f62b105bcb8cd8a7a95db56ec92cdaf0d7632fcb079fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page