From 33260592f52a1d9a1d4b825239bce950a59158a2 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Mon, 27 May 2024 18:33:53 -0500 Subject: [PATCH] readme update --- README.md | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 5e40971..aede765 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,39 @@ # Restic Scripts +Purpose: + +- Wrap `restic` with the ability to start/stop Docker containers +- Send updates to Loki server + ## Environment Variables Recommended to put these in the relevant `~/.bashrc` file | Env Variable | Description | -|---------------------|--------------------------------------------------------------------------------------------| +| ------------------- | ------------------------------------------------------------------------------------------ | +| `HOSTNAME` | Network hostname of where the backup is running | | `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` | -## Usage +## Loki Updates -### Python +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 ```shell python -m restic.snapshots ``` +To stop docker containers before the backup and start them again afterwards, use the `--project` and `--services` flags. + ```shell python -m restic.backup --tag manual --project joplin --services app,db ``` @@ -26,21 +41,3 @@ python -m restic.backup --tag manual --project joplin --services app,db ```shell python -m restic.prune ``` - -### Shell Scripts - -```shell -./restic_command.sh snapshots -``` - -```shell -./restic_backup.sh --tag manual -``` - -```shell -./restic_command.sh forget --keep-last 1 -``` - -```shell -./restic_command.sh restore -```