Files
restic-scripts/README.md
John Lancaster 58e581b303 readme update
2024-06-15 15:07:34 -05:00

2.2 KiB

Restic Scripts

Purpose:

Warning

This behvior does not work on the resticprofile branch

  • Wrap restic with 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 resticprofile branch

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