https://github.com/maxisme/mega-backup
https://github.com/maxisme/mega-backup
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/maxisme/mega-backup
- Owner: maxisme
- Created: 2020-05-29T16:09:13.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-22T09:59:54.000Z (about 6 years ago)
- Last Synced: 2025-12-18T09:28:36.652Z (6 months ago)
- Language: Go
- Size: 74.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mega-backup
## Setup
1. Add cron job to your liking:
```
*/20 * * * * python backup-servers.py
0 * * * * backup-servers.sh
```
2. Add servers to backup in the `servers.json`:
```json
{
"servers": {
"server-name": {
"host": "root@1.2.3.4",
"ssh-port": 22,
<<<<<<< HEAD
"exclude-dirs": []
=======
"exclude-dirs": [],
"mega": true
>>>>>>> a01344162fc3824600d92d18f55a24bfdc0ab114
}
},
"exclude-dirs": [
"/dev/*",
"/proc/*",
"/sys/*",
"/tmp/*",
"/run/*",
"/mnt/*",
"/media/*",
"/lost+found/*",
"/var/log/*",
"/var/lib/docker/*"
],
"encryption-key": "CHANGE ME"
}
```
3. An example docker-compose.yml may look like this:
```yaml
version: '3.1'
services:
backup:
build: .
environment:
- HOST=${HOST:?err}
- CREDENTIALS=${CREDENTIALS:?err}
- CRON=0 */12 * * *
volumes:
- "./servers.json:/app/servers.json"
- "/root/.ssh:/root/.ssh"
- "./backup/:/backup/"
```
## Decrypting backup
To decrypt backup simply run inside the `cmd` directory:
```
$ go run . /path/to/file key
```