Skip to content
developerabdanPublic

About

Database Backup Tools that lives in your vm

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

dbak

A database backup agent for Linux virtual machines.

dbak makes backups of PostgreSQL, MySQL, and MariaDB databases on a schedule. It sends the backups directly to an SFTP server. It can encrypt each backup with age before the upload.

Install

curl -fsSL https://raw.githubusercontent.com/developerabdan/dbak/main/install.sh | sudo bash

The script installs /usr/local/bin/dbak and starts dbak init. dbak init asks some questions, installs the schedule, and starts the first backup.

To see the result, run dbak status.

Restore

On the VM, run sudo dbak restore. Select the source and the backup, and type the directory. If the backup is encrypted, paste the age private key. dbak writes the dump to the directory, by default ~/backups.

Without dbak, you can restore a backup on a different computer. You need the private key, age, and zstd.

  1. On your computer, install age and zstd.
  2. Download the backup from the SFTP server.
  3. Decrypt the backup:
age -d -i key.txt encryptedfile.sql.zst.age | zstd -d -o output.sql

For a PostgreSQL backup, use age -d -i key.txt file.dump.age > output.dump. Then restore it with pg_restore.

Documentation

License

MIT license, see LICENSE.

About

Database Backup Tools that lives in your vm

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages