k8up-io / wrestic

Restic Backup Kubernetes and OpenShift Wrapper - Part of K8up
BSD 3-Clause "New" or "Revised" License
16 stars 3 forks source link

Pass multiple 'option' flags to restic #89

Closed cimnine closed 3 years ago

cimnine commented 3 years ago

When this PR is merged, wrestic looks for a new environment variable RESTIC_OPTIONS. It can be used to pass --option flags to wrestic, see https://restic.readthedocs.io/en/stable/manual_rest.html:

$ ./restic --help

restic is a backup program which allows saving multiple revisions of files and
directories in an encrypted repository stored on different backends.

Usage:
  restic [command]

Available Commands:
  backup        Create a new backup of files and/or directories
  cache         Operate on local cache directories
  cat           Print internal objects to stdout
  ...

Flags:
  ...
  -o, --option key=value           set extended option (key=value, can be specified multiple times)
  ...

Intended usage:

docker run -e "RESTIC_OPTIONS=key1=value,key2=value" -e "HOSTNAME=test" -e "PROM_URL=http://192.168.1.43:9091" -v /path/to/back:/data/ wrestic/wrestic

This is required for https://github.com/vshn/k8up/issues/424.

cimnine commented 3 years ago

Needs to be rebased onto https://github.com/vshn/wrestic/pull/90 to get tests passing