Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

AutoBackup Database Manager

A cross-platform desktop application built with Tauri (Rust + React) for automated database backups and restoration.

Features

  • Automated Backups: Schedule backups using cron expressions
  • PostgreSQL Support: Full backup and restore capabilities for PostgreSQL databases
  • Secure Credentials: Passwords stored in OS keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service)
  • Compressed Archives: Backups stored as .tar.gz files to save space
  • Easy Restoration: Browse backups and restore with a few clicks
  • Project Management: Organize multiple database backup projects
  • Workspace Organization: All backups stored in a configurable workspace directory

Prerequisites

  • Node.js (v16 or higher)
  • Rust (latest stable)
  • PostgreSQL Client Tools: pg_dump, pg_restore, and psql must be installed and available in PATH

Installing PostgreSQL Client Tools

macOS:

brew install postgresql

Linux (Ubuntu/Debian):

sudo apt-get install postgresql-client

Windows: Download and install PostgreSQL from postgresql.org

Installation

  1. Clone the repository:
cd autobackup-app
  1. Install dependencies:
npm install
  1. Build the application:
npm run tauri build

The built application will be in src-tauri/target/release/bundle/

Development

Run in development mode:

npm run tauri dev

Usage

First Launch

  1. Configure your workspace directory where backups will be stored
  2. Click "Continue" to proceed

Creating a Backup Project

  1. Click "+ New Project"
  2. Fill in the project details:
    • Project Name: Unique identifier for this backup project
    • Database Type: PostgreSQL (more types coming soon)
    • Host: Database server hostname or IP
    • Port: Database port (default: 5432)
    • Database Name: Name of the database to backup
    • Username: Database user
    • Password: Database password (stored securely in OS keychain)
    • Schedule: Optional cron expression (e.g., 0 2 * * * for daily at 2 AM)
  3. Click "Test Connection" to verify credentials
  4. Click "Create Project"

Manual Backup

  1. From the Projects list, click "Backup Now" for any project
  2. Wait for the backup to complete
  3. Backup file will be saved as {project-name}_{timestamp}.tar.gz

Viewing Backups

  1. Click "View Backups" for a project
  2. See all available backups with filename, size, and creation date

Restoring a Backup

  1. In the Backups view, click "Restore" for any backup
  2. Choose restore mode:
    • Replace: Drop existing database and restore (requires confirmation)
    • New Database: Create a new database with specified name
  3. Configure target database connection (can be different from source)
  4. Click "Restore"

Scheduled Backups

Backups with a schedule will run automatically in the background according to the cron expression.

Common Cron Expressions:

  • 0 2 * * * - Daily at 2:00 AM
  • 0 */6 * * * - Every 6 hours
  • 0 0 * * 0 - Weekly on Sunday at midnight
  • 0 3 * * 1-5 - Weekdays at 3:00 AM

Project Structure

autobackup-app/
├── src/                    # React frontend
│   ├── components/         # UI components
│   ├── api.ts             # Tauri API bindings
│   └── App.tsx            # Main application
├── src-tauri/             # Rust backend
│   └── src/
│       ├── modules/       # Core modules
│       │   ├── config.rs      # Configuration management
│       │   ├── project.rs     # Project data structures
│       │   ├── backup.rs      # Backup operations
│       │   ├── restore.rs     # Restore operations
│       │   ├── credentials.rs # Keychain integration
│       │   └── scheduler.rs   # Cron scheduling
│       └── lib.rs         # Tauri commands
└── .sisyphus/
    └── plans/
        └── autobackup-prd.md  # Product Requirements Document

File Locations

  • Configuration: ~/.autobackup/config.json
  • Project Metadata: {workspace}/.autobackup/projects.json
  • Backups: {workspace}/{project-name}/backups/
  • Credentials: OS keychain (secure storage)

Troubleshooting

"pg_dump not found"

Ensure PostgreSQL client tools are installed and in your PATH:

which pg_dump  # macOS/Linux
where pg_dump  # Windows

Connection Failed

  • Verify database is running and accessible
  • Check firewall settings
  • Confirm credentials are correct
  • Test connection using psql command line

Backup Failed

  • Ensure sufficient disk space
  • Check database user has necessary permissions
  • Review error message for specific issue

Restore Failed

  • Verify target database exists (or use "New Database" mode)
  • Ensure user has CREATE DATABASE permission for new database mode
  • Check backup file is not corrupted

Roadmap

  • MySQL/MariaDB support
  • MongoDB support
  • SQLite support
  • Backup retention policies
  • Remote storage (S3, FTP)
  • Backup encryption
  • Email notifications
  • Backup verification/testing

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages