63d4eae270147d31f38053d6fe2ebbea0fc93099
Restic Scripts
Purpose:
- Wrap
resticwith the ability to start/stop Docker containers - Send updates to Loki server
Installation
Include in Repo
From a parent repo, add this one as a submodule:
git submodule add https://gitea.john-stream.com/john/restic-scripts
Then add this to the docker-compose.yml file of the parent.
include:
- restic-scripts/docker-compose.yml
Environment Variables
Put these in ./restic-scripts/.env, which is on the .gitignore list.
| Env Variable | Description |
|---|---|
BACKUP_DIR |
Directory to back up |
RESTIC_REPOSITORY |
Directory for the restic repository. This is usually on a mount point made from Proxmox |
TZ |
Set to modify the timezone shown in the scheduler |
Key file
The password needs to be stored in ./restic-scripts/key. Make sure it has the right (secure) permissions.
sudo chown root:root ./restic-scripts/key && sudo chmod 600 ./restic-scripts/key
Loki Updates
Warning
This doesn't currently work on the
resticprofilebranch
Updates sent to Loki will have the following labels:
| Label | Description |
|---|---|
host |
Hostname set by the environment variable HOSTNAME |
backup |
String representing the type of update e.g. backup, prune, forget, or size |
Usage
Check snapshots
docker compose exec backup resticprofile snapshots
Dry-run a backup
docker compose exec backup resticprofile --dry-run backup
Check crontab entry in container
docker compose exec backup cat /var/spool/cron/crontabs/root
Description
Languages
Python
100%