Single binary backup manager written in Golang.
You can install backup-manager by downloading the latest release from the releases page.
You need to have Golang installed in order to build backup-manager from source.
- Clone:
git clone git@github.com:Yendric/backup-manager.git
- Build:
go build
- Configure:
cp config.yaml.example config.yaml
- Run:
./backup-manager
Backup Manager is an open source single binary backup manager written in Golang. It allows you to manage your backups in a simple way and sends notifications when doing so.
Backups and notifications are defined in a config.yaml
file. This file also allows you to configure custom actions you can run on backups (you can do more stuff than just create backups). These custom actions (eg. create, restore, delete, ...) are commands that are executed by the backup manager: this can be a bash script, a binary or anything else that can be executed by the system.
After configuring the config.yaml file, you can use Backup Manager as follows:
./backup-manager create [-b backupname]
./backup-manager list
The list command also allows you to select and manage files.
./backup-manager manage [-b backupname] [-i fileindex] [-a actionname]
Configuration is done in a config.yaml
file. You can find an example configuration in config.yaml.example
.
notification:
email:
enabled: false
fromAddress: ""
smtpHost: "smtp.example.com"
smtpPort: 587
smtpUsername: ""
smtpPassword: ""
to: []
webhook:
enabled: false
contentField: "content"
url: "https://hooks.example.com/services/"
backups:
- name: "backup1"
createScript: "/path/to/backup1/backup.sh"
backupDir: "backups"
actions:
- name: "restore"
script: "/path/to/backup1/restore.sh"
- name: "delete"
script: "/path/to/backup1/delete.sh"
Personally I use backup-manager to manage my restic backups on remote servers. Below I left an example script which you can use as a template to manage your restic backups.
# This, besides opening an ssh connection, also creates a tunnel from the remote computer to the local backupserver, which runs restic on port 8000
ssh -R 8000:localhost:8000 username@example.com <<'EOL'
# Restic repo password
echo "RESTIC_PASSWORD" > ~/.resticrepo
# Run restic backup
restic -r rest:http://localhost:8000/reponame --password-file="/home/username/.resticrepo" --verbose backup /
# Remove restic repo password
rm ~/.resticrepo
EOL
You're always welcome to create an issue/PR if you have suggestions or find mistakes.