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.
curl -fsSL https://raw.githubusercontent.com/developerabdan/dbak/main/install.sh | sudo bashThe 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.
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.
- On your computer, install age and
zstd. - Download the backup from the SFTP server.
- Decrypt the backup:
age -d -i key.txt encryptedfile.sql.zst.age | zstd -d -o output.sqlFor a PostgreSQL backup, use age -d -i key.txt file.dump.age > output.dump.
Then restore it with pg_restore.
- Features
- Install: requirements, installer options, and setup without questions.
- Commands: all commands and exit codes.
- Configuration: the config file, retention, and notifications.
- Encryption and restore
- Files: backup file names and files on the server.
- Development: build, test, and release.
MIT license, see LICENSE.