https://github.com/rogercoll/replica
Generate and replicate backups to any system
https://github.com/rogercoll/replica
backup go replication ssh targz
Last synced: about 1 month ago
JSON representation
Generate and replicate backups to any system
- Host: GitHub
- URL: https://github.com/rogercoll/replica
- Owner: rogercoll
- License: mit
- Created: 2021-07-04T08:29:44.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-24T18:37:08.000Z (almost 4 years ago)
- Last Synced: 2025-03-20T14:52:51.827Z (about 1 month ago)
- Topics: backup, go, replication, ssh, targz
- Language: Go
- Homepage:
- Size: 1.13 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Replica
Replica is a tool to generate directory backups and replicate them in multiple environments. It is a plugin-driven application, and for the moment it distinguishes 2 plugin types:
1. [Backup Plugins](#backup-plugins) generate backups of a system
2. [Distributor Plugins](#distributor-plugins) distributes the previous backups among diferent systemsNew plugins are designed to be easy to contribute, pull requests are super welcomed. For example, databases backup plugins or cloud services distributor like AWS S3.
## Installation:
### From Source:Replica requires Go version 1.14 or newer, the Makefile requires GNU make.
1. [Install Go](https://golang.org/doc/install) >=1.14 (1.15 recommended)
2. Clone the Replica repository:
```
git clone https://github.com/rogercoll/replica.git
```
3. Run `make` from the source directory
```
make build
sudo cp ./replica /usr/bin
```## Backup Plugins
* [targz](./plugins/backup/targz)
## Distributor Plugins
* [local](./plugins/distributors/local)
* [ssh](./plugins/distributors/ssh)## Configuration
Replica will try to find a default config file at these locations (in order):
1. $REPLICA_CONFIG_PATH
2. $HOME/.replica/replica.conf
3. /etc/replica/replica.confExample file:
```toml
[[backup.targz]]
paths = ["/home/neck/influxd"]
# Time format to be used in the backup file names (https://golang.org/pkg/time/#Time)
# Default is layoutISO = "2006-01-02"[[distributor.local]]
destinations = ["/home/neck/backups/", "/home/neck/backups/test1/", "/home/neck/backups/test2/"][[distributor.ssh]]
hosts = ["192.168.1.90:22:pi"]
passwords = [""]
destinations = ["/home/pi/extBackups/"]
```The file [plugins](./Plugins.md) contains additional information on how to check and get a sample configuration for each available plugin.
## How to use it?
Once a configuration file has been defined with the desired plugins, you can simple run it:
```bash
replica
```The best would be to add the execution as a cron job, thus automatically make and replicate backups when needed.
**The program workflow is based on [Telegraf](https://github.com/influxdata/telegraf) agent, kudos to them for the great work!**