backup
What is this?
A Simple program to automatically backup a database using git.
Err handling by Sentry, Uses heartbeats by Betteruptime
Made with
Installation
Via Go
go get github.com/joshhhhyyyy/backup
go install github.com/joshhhhyyyy/backup
export PATH=$PATH:$(go env GOPATH)/bin
(Add gopath to path)
Via apt
echo "deb [trusted=yes] https://apt.joseos.com/ ./" | sudo tee /etc/apt/sources.list.d/joseos.list
sudo apt update
sudo apt install backup
Usage
Systemd Timers
Sample Service file | Sample Timer file
Basically, systemd timers is a great alternative to cronjobs as it can be invoked and controlled via systemctl.
Every timer has a corresponding service file that it invokes when the time specified is hit. In the sample files provided, the timer triggers a backup at 4am and 59seconds daily.
Manual Usage
This program can also be run manually with the command, where you can specify the commit message as well
backup [OPTIONS]
Options
**note: both single minus "-" and double minus "--" work fine
-key=""
// Required, Type: string, Sentry.io dsn (key url) for project
-bup=""
// Optional, Type: string, betteruptime heartbeat url, eg. "https://betteruptime.com/api/v1/~~~"
-message=""
// Not needed at all, Type: string, optional commit message to pass for manual runs