Backupd
A powerful, menu-driven backup solution for web applications and MySQL/MariaDB databases. Secure credential storage, remote cloud storage integration, and easy restoration.
Install / Use
/learn @wnstify/BackupdREADME
Backupd
A secure, automated backup solution for web applications and MySQL/MariaDB databases with encrypted cloud storage. Supports multiple hosting panels and application types.
By Backupd
Overview
This tool provides a complete backup solution for web hosting environments:
- Database Backups — Dumps all MySQL/MariaDB databases, encrypted and deduplicated by restic, stored via rclone to cloud storage
- File Backups — Archives web applications (WordPress, Laravel, Node.js, PHP, etc.) with restic deduplication and encryption
- Secure Credential Storage — All credentials (database, cloud storage) are encrypted with AES-256 and bound to your server's machine-id
- Automated Scheduling — Uses systemd timers for reliable, automatic backups with retry on failure
- Retention & Cleanup — Automatic deletion of old backups based on configurable retention policy
- Backup Verification — Weekly quick checks (no download), monthly reminders to test restorability
- Easy Restore — Interactive wizard to browse and restore from any backup point
- Notifications — Optional alerts via ntfy.sh push notifications AND/OR custom webhooks
┌─────────────────────────────────────────────────────────────────┐
│ Your Server │
│ ┌──────────┐ ┌────────────────────────────┐ ┌──────────┐ │
│ │ Database │───▶│ Restic │──│ rclone │──┼──▶ Cloud Storage
│ │ Dump │ │ (encrypt + dedup + verify) │ │(transport)│ │ (S3/B2/etc)
│ └──────────┘ └────────────────────────────┘ └──────────┘ │
│ │
│ ┌──────────┐ ┌────────────────────────────┐ ┌──────────┐ │
│ │ Web │───▶│ Restic │──│ rclone │──┼──▶ Cloud Storage
│ │ Apps │ │ (encrypt + dedup + verify) │ │(transport)│ │
│ └──────────┘ └────────────────────────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────────────┘
v3.0 Architecture: Restic handles all backup operations (encryption, deduplication, verification). rclone provides cloud storage transport to 40+ providers. See CHANGELOG.md for details.
Why This Tool?
Panel backups fail silently. Whether you're using cPanel, Plesk, Enhance, xCloud, or any other hosting panel — their built-in backup systems can fail without warning. You need an independent backup layer that:
- Works alongside (not instead of) your panel's backups
- Stores backups off-server in cloud storage
- Encrypts sensitive data (database credentials, backups)
- Runs automatically on a schedule
- Notifies you of success or failure
This tool provides exactly that.
Features
- 🗄️ Database Backups — All MySQL/MariaDB databases, individually compressed and encrypted
- 📁 Web App File Backups — Backs up any web application (WordPress, Laravel, Node.js, PHP, static sites)
- 🖥️ Multi-Panel Support — Auto-detects Enhance, xCloud, RunCloud, Ploi, cPanel, Plesk, CloudPanel, CyberPanel, aaPanel, HestiaCP, FlashPanel, Virtualmin
- 🐧 Multi-Distribution Support — Works on Debian, Ubuntu, Fedora, RHEL, CentOS, Arch, Alpine, openSUSE and derivatives
- 🔐 Machine-Bound Encryption — Credentials encrypted with AES-256, tied to your server
- ☁️ Cloud Storage — Supports 40+ providers via rclone (S3, B2, Wasabi, Google Drive, etc.)
- ⏰ Automated Scheduling — Systemd timers or cron fallback for non-systemd systems
- 🧹 Retention & Cleanup — Configurable retention policy with automatic old backup deletion
- ✅ Integrity Verification — SHA256 checksums, quick checks (no download), and monthly full test reminders
- 🔔 Triple-Channel Notifications — Optional alerts via ntfy.sh, Pushover, AND/OR custom webhooks on backup events
- 🔄 Easy Restore — Interactive restore wizard with safety backups and checksum verification
- 📋 Detailed Logging — Full logs with timestamps and automatic log rotation
- 🔄 Auto-Update — Built-in update system with version checking and one-click updates
Quick Install
curl -fsSL https://raw.githubusercontent.com/wnstify/backupd/main/install.sh | sudo bash
Then run the setup wizard:
sudo backupd
That's it! The wizard will guide you through configuration.
Install from Develop Branch (Testing)
curl -fsSL https://raw.githubusercontent.com/wnstify/backupd/develop/install.sh | sudo bash -s -- --branch develop
Requirements
| Requirement | Notes | |-------------|-------| | OS | Ubuntu, Debian, Fedora, RHEL, CentOS, Arch, Alpine, openSUSE (and derivatives) | | Access | Root or sudo | | MySQL/MariaDB | For database backups | | systemd or cron | For scheduled backups (cron fallback for Alpine/Docker/RHEL6) | | curl or wget | At least one required for downloads | | restic | Auto-installed (backup engine with encryption + deduplication) | | rclone | Auto-installed (cloud storage transport) | | argon2 | Auto-installed (modern encryption, falls back to PBKDF2 if unavailable) | | bzip2, unzip | Auto-installed (for extracting restic and rclone) |
What Gets Installed
/etc/backupd/
├── backupd.sh # Main script (entry point)
├── lib/ # Modular library
│ ├── core.sh # Colors, validation, helpers
│ ├── logging.sh # Structured logging with auto-redaction
│ ├── debug.sh # Legacy debug logging
│ ├── crypto.sh # Encryption, secrets
│ ├── config.sh # Configuration read/write
│ ├── generators.sh # Script generation
│ ├── status.sh # Status display
│ ├── backup.sh # Backup execution
│ ├── verify.sh # Integrity verification
│ ├── restore.sh # Restore execution
│ ├── schedule.sh # Schedule management
│ ├── setup.sh # Setup wizard
│ ├── updater.sh # Auto-update functionality
│ ├── cli.sh # CLI subcommand dispatcher
│ └── notifications.sh # Notification configuration
├── .config # Configuration (retention, paths, etc.)
├── scripts/
│ ├── db_backup.sh # Database backup script
│ ├── db_restore.sh # Database restore script
│ ├── files_backup.sh # Files backup script
│ ├── files_restore.sh # Files restore script
│ ├── verify_backup.sh # Quick integrity check (weekly)
│ └── verify_reminder.sh # Full test reminder (monthly)
└── logs/
├── db_logfile.log # Database backup logs (auto-rotated)
├── files_logfile.log # Files backup logs (auto-rotated)
├── verify_logfile.log # Verification logs (auto-rotated)
└── notification_failures.log # Failed notification attempts
/var/log/backupd.log # Structured error log (auto-created)
/etc/.{random}/ # Encrypted secrets (hidden, immutable)
├── .s # Salt for key derivation
├── .algo # Encryption version (1, 2, or 3)
├── .c1 # Encryption passphrase
├── .c2 # Database username
├── .c3 # Database password
├── .c4 # ntfy token (optional)
├── .c5 # ntfy URL (optional)
├── .c6 # webhook URL (optional)
├── .c7 # webhook auth token (optional)
├── .c8 # Pushover user key (optional)
└── .c9 # Pushover API token (optional)
/usr/local/bin/backupd # Symlink for easy access
/etc/systemd/system/
├── backupd-db.service
├── backupd-db.timer
├── backupd-files.service
├── backupd-files.timer
├── backupd-verify.service # Weekly quick check
├── backupd-verify.timer
├── backupd-verify-full.service # Monthly reminder (no download)
└── backupd-verify-full.timer
Usage
Interactive Menu
sudo backupd
╔═══════════════════════════════════════════════════════════╗
║ Backupd v3.2.4 ║
║ by Backupd ║
╚═══════════════════════════════════════════════════════════╝
Main Menu
=========
1. Run backup now
2. Restore from backup
3. Verify backups
4. View status
5. View logs
6. Manage schedules
7. Notifications
8. Reconfigure
9. Uninstall
U. Update tool
0. Exit
CLI Subcommands
# Backup commands
sudo backupd backup db # Backup databases
sudo backupd backup files # Backup files
sudo backupd backup all # Backup both
# Restore commands
sudo backupd restore db # Restore database
sudo backupd restore files # Restore files
sudo backupd restore db --list # List available backups
# Status and verification
sudo backupd status # Show system status
sudo backupd verify # Quick verification
sudo backupd verify --full # Full verification
# Schedule management
sudo backupd schedule list # List active schedules
sudo backupd schedule enable # Enable schedules
sudo backupd schedule disable # Disable schedules
# View logs
sudo backupd logs # View all logs
sudo backupd logs db --lines 50 # Last 50 lines of db log
# Backup history
sudo backupd history # Last 20 operations
sudo backupd history db -n 50 # Last 50 database backups
sudo backupd history verify # Verification history
sudo backupd history --json # JSON output for APIs
# Multi-job management (v3.
