117 lines
2.6 KiB
Markdown
117 lines
2.6 KiB
Markdown
# TISBackup
|
|
|
|
This is the repository of the TISBackup project, licensed under GPLv3.
|
|
|
|
TISBackup is a python script to backup servers.
|
|
|
|
It runs at regular intervals to retrieve different data types on remote hosts
|
|
such as database dumps, files, virtual machine images and metadata.
|
|
|
|
## Install using Compose
|
|
|
|
Clone that repository and build the pod image using the provided `Dockerfile`
|
|
|
|
```bash
|
|
docker build . -t tisbackup:latest
|
|
```
|
|
|
|
In another folder, create subfolders as following
|
|
|
|
```bash
|
|
mkdir -p /var/tisbackup/{backup/log,config,ssh}/
|
|
```
|
|
|
|
Expected structure
|
|
```
|
|
/var/tisbackup/
|
|
└─backup/ <-- backup location
|
|
└─config/
|
|
├── tisbackup-config.ini <-- backups config
|
|
└── tisbackup_gui.ini <-- tisbackup config
|
|
└─ssh/
|
|
├── id_rsa <-- SSH Key
|
|
└── id_rsa.pub <-- SSH PubKey
|
|
compose.yaml
|
|
```
|
|
|
|
Adapt the compose.yml file to suits your needs, one pod act as the WebUI front end and the other as the crond scheduler
|
|
|
|
```yaml
|
|
services:
|
|
tisbackup_gui:
|
|
container_name: tisbackup_gui
|
|
image: "tisbackup:latest"
|
|
build: .
|
|
volumes:
|
|
- ./config/:/etc/tis/
|
|
- ./backup/:/backup/
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
restart: unless-stopped
|
|
ports:
|
|
- 9980:8080
|
|
|
|
tisbackup_cron:
|
|
container_name: tisbackup_cron
|
|
image: "tisbackup:latest"
|
|
build: .
|
|
volumes:
|
|
- ./config/:/etc/tis/
|
|
- ./ssh/:/config_ssh/
|
|
- ./backup/:/backup/
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
restart: always
|
|
command: "/bin/bash /opt/tisbackup/cron.sh"
|
|
|
|
```
|
|
|
|
## Configuration
|
|
|
|
* Provide an SSH key and store it in `./ssh`
|
|
* Setup config files in the `./config` directory
|
|
|
|
**tisbackup-config.ini**
|
|
|
|
```ini
|
|
[global]
|
|
backup_base_dir = /backup/
|
|
|
|
# backup retention in days
|
|
backup_retention_time=90
|
|
|
|
# for nagios check in hours
|
|
maximum_backup_age=30
|
|
|
|
[srvads-poudlard-samba]
|
|
type=rsync+ssh
|
|
server_name=srvads.poudlard.lan
|
|
remote_dir=/var/lib/samba/
|
|
compression=True
|
|
;exclude_list="/proc/**","/sys/**","/dev/**"
|
|
private_key=/config_ssh/id_rsa
|
|
ssh_port = 22
|
|
```
|
|
|
|
**tisbackup_gui.ini**
|
|
```ini
|
|
[general]
|
|
config_tisbackup= /etc/tis/tisbackup-config.ini
|
|
sections=
|
|
ADMIN_EMAIL=josebove@internet.fr
|
|
base_config_dir= /etc/tis/
|
|
backup_base_dir=/backup/
|
|
```
|
|
|
|
Run!
|
|
```bash
|
|
docker compose up -d
|
|
```
|
|
|
|
## About
|
|
|
|
[Tranquil IT](contact_at_tranquil_it) is the original author of TISBackup.
|
|
|
|
The documentation is provided under the license CC-BY-SA and can be found
|
|
on [readthedoc](https://tisbackup.readthedocs.io/en/latest/index.html).
|