2024-06-28 20:15:14 -05:00
2024-06-28 20:15:14 -05:00
2024-06-15 15:08:05 -05:00
2024-06-28 20:10:47 -05:00
2024-06-28 20:15:14 -05:00
2024-06-28 20:10:47 -05:00

Restic Scripts

Purpose:

  • Wrap restic with the ability to start/stop Docker containers
  • Send updates to Loki server

Environment Variables

Put these in a .env file in the directory that the backup will be run from.

Env Variable Description
HOSTNAME Network hostname of where the backup is running. Used to tag the backups in restic
BACKUP_DIR Directory to back up
RESTIC_REPOSITORY Directory for the restic repository. This is usually on a mount point made from Proxmox
RESTIC_PASSWORD Password for the restic repository
LOKI_URL Push URL for Loki. Should include the port and end with something like /loki/api/v1/push

Loki Updates

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

python -m restic.snapshots

To stop docker containers before the backup and start them again afterwards, use the --project and --services flags.

python -m restic.backup --tag manual --project joplin --services app,db
python -m restic.prune
Description
No description provided
Readme 109 KiB
Languages
Python 100%