↑ ↓ to move · Enter to open · Esc to close Something not working? Troubleshooting
    On this page

    Backup

    Take a consistent snapshot of your history database so you can recover from mistakes. Suvadu also snapshots automatically before any destructive delete.

    Quick Start

    Run suv backup to write a timestamped copy of your database into the backups directory.

    suv backup
    # ✓ Backed up to ~/Library/Application Support/suvadu/backups/history-20260621-091500.db (34.0 MB)

    Write the snapshot to a specific path with --out:

    suv backup --out ~/suvadu-backup.db

    How It Works

    Backups use SQLite's VACUUM INTO, producing a compact, internally-consistent copy even while the database is in use. The copy is written with owner-only permissions, since it contains your shell history.

    Where backups live

    • macOS: ~/Library/Application Support/suvadu/backups/
    • Linux: ~/.local/share/suvadu/backups/

    The directory is created on first use with 0700 permissions.

    Automatic Backup Before Delete

    Because suv delete is irreversible, Suvadu writes a snapshot to the backups directory before deleting, and aborts the delete if that snapshot fails. Skip it with --no-backup if you're sure.

    suv delete "old-pattern"        # backs up first, then deletes
    suv delete "old-pattern" --no-backup   # skip the safety snapshot

    Backup vs. Export

    suv backup and suv export serve different purposes:

    • suv backup — a full, exact database snapshot for recovery. Restore by replacing your database file with the snapshot.
    • suv export — a portable JSONL/CSV dump for moving history between machines or analysis, imported with suv import.

    Restoring

    There is no restore command. To go back to a backup, first close everything that uses Suvadu — other suv commands, and any AI tool running its MCP server. Then copy the backup over history.db and delete the history.db-wal and history.db-shm files beside it, so no leftover journal is applied to the restored file. On macOS:

    cd ~/Library/Application\ Support/tech.appachi.suvadu
    cp backups/history-20260621-091500.db history.db
    rm -f history.db-wal history.db-shm

    On Linux the directory is ~/.local/share/suvadu.

    Tips

    • Schedule periodic snapshots with cron: 0 9 * * * suv backup.
    • The backups directory accumulates snapshots over time — prune old ones manually when needed.