tenangdb

module
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2025 License: MIT

README ΒΆ

TenangDB

πŸ›‘οΈ Backup yang Bikin Tenang - MySQL backup solution with auto-discovery and cloud integration.

Zero-configuration backup system that just works.

⚑ Installation

# One-liner install
curl -sSL https://raw.githubusercontent.com/abdullahainun/tenangdb/main/install.sh | bash

# Install dependencies
brew install mydumper rclone mysql-client  # macOS
sudo apt install mydumper rclone mysql-client  # Ubuntu
sudo dnf install mydumper rclone mysql  # CentOS/Fedora

πŸš€ Quick Start

# 1. Get config template
curl -L https://raw.githubusercontent.com/abdullahainun/tenangdb/main/config.yaml.example -o config.yaml

# 2. Edit with your database credentials
nano config.yaml

# 3. Run backup
tenangdb backup

βš™οΈ Basic Config

database:
  host: your_mysql_host
  username: your_username
  password: your_password
  mydumper:
    enabled: true

backup:
  databases:
    - your_database1
    - your_database2

# Optional: Cloud upload
upload:
  enabled: false
  destination: "your-remote:backup-folder"

Auto-Discovery Features:

  • Binary paths (mydumper, myloader, rclone, mysql)
  • Backup directories (platform-specific)
  • Log locations and optimal settings

πŸ“‹ Commands

tenangdb backup                    # Backup all databases
tenangdb backup --databases db1,db2   # Backup specific databases
tenangdb restore --backup-path /path/to/backup --database target_db
tenangdb cleanup --force           # Clean old backups
tenangdb config                   # Show configuration

πŸ”§ Advanced

MySQL User Setup
-- Create dedicated user
CREATE USER 'tenangdb'@'%' IDENTIFIED BY 'secure_password';
GRANT SELECT, SHOW DATABASES, SHOW VIEW, LOCK TABLES, EVENT, TRIGGER, ROUTINE, RELOAD, REPLICATION CLIENT ON *.* TO 'tenangdb'@'%';
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX, REFERENCES, CREATE TEMPORARY TABLES, CREATE VIEW ON *.* TO 'tenangdb'@'%';
FLUSH PRIVILEGES;
Cloud Storage Setup
# Configure rclone
rclone config

# Test connection
rclone lsf your-remote:

# Enable in config.yaml
upload:
  enabled: true
  destination: "your-remote:database-backups"
Production Deployment
# Install system-wide
curl -L https://github.com/abdullahainun/tenangdb/releases/latest/download/tenangdb-linux-amd64 -o tenangdb
sudo mv tenangdb /usr/local/bin/ && sudo chmod +x /usr/local/bin/tenangdb

# Setup config
sudo mkdir -p /etc/tenangdb
curl -L https://raw.githubusercontent.com/abdullahainun/tenangdb/main/config.yaml.example | sudo tee /etc/tenangdb/config.yaml
sudo nano /etc/tenangdb/config.yaml

πŸ“‹ Details

Directory Structure
Backups: ~/Library/Application Support/TenangDB/backups/ (macOS)
         ~/.local/share/tenangdb/backups/ (Linux)

Structure: {backup-dir}/{database}/{YYYY-MM}/{backup-timestamp}/
Cloud:     {destination}/{database}/{YYYY-MM}/{backup-timestamp}/
Compatibility

mydumper: v0.9.1+ (Ubuntu 18.04) to v0.19.3+ (macOS Homebrew)
MySQL: 5.7+, 8.0+, MariaDB 10.3+
Platforms: macOS (Intel/Apple Silicon), Linux (Ubuntu/CentOS/Debian/Fedora)

Documentation: Installation Guide β€’ MySQL Setup β€’ Production Deployment β€’ Config Reference

Troubleshooting

Binary not found:

which tenangdb || curl -sSL https://raw.githubusercontent.com/abdullahainun/tenangdb/main/install.sh | bash

Dependencies missing:

which mydumper myloader rclone mysql
# Install: brew/apt/dnf install mydumper rclone mysql-client

Connection failed:

mysql -h your_host -u your_user -p
SHOW GRANTS FOR 'your_user'@'%';

Debug mode:

tenangdb backup --log-level debug --dry-run

Support: Issues β€’ License: MIT

Directories ΒΆ

Path Synopsis
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL