2021-04-30 08:47:29 +00:00
|
|
|
|
# Options
|
|
|
|
|
|
2021-10-28 16:09:38 +00:00
|
|
|
|
For the `backup` and `forget` commands you can pass any native flags to `restic`. In addition you can specify flags for every command with `all`.
|
2021-04-30 08:47:29 +00:00
|
|
|
|
|
2021-10-28 16:09:38 +00:00
|
|
|
|
If flags don't start with `-` they will get prefixed with `--`.
|
|
|
|
|
|
|
|
|
|
Flags without arguments can be set to `true`. They will be handled accordingly.
|
|
|
|
|
|
|
|
|
|
> ℹ️ It is also possible to set options for an [entire backend](/backend/options) or globally (see below).
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
locations:
|
|
|
|
|
foo:
|
|
|
|
|
# ...
|
|
|
|
|
options:
|
|
|
|
|
all:
|
|
|
|
|
some-flag: 123
|
|
|
|
|
# Equivalent to
|
|
|
|
|
--some-flag: 123
|
|
|
|
|
backup:
|
|
|
|
|
boolean-flag: true
|
|
|
|
|
tag:
|
|
|
|
|
- foo
|
|
|
|
|
- bar
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
2021-11-01 10:19:27 +00:00
|
|
|
|
In this example, whenever `autorestic` runs `restic backup` it will append a `--tag foo --tag bar` to the native command.
|
2021-05-17 20:40:23 +00:00
|
|
|
|
|
2021-04-30 08:47:29 +00:00
|
|
|
|
```yaml
|
|
|
|
|
locations:
|
|
|
|
|
foo:
|
|
|
|
|
path: ...
|
|
|
|
|
to: ...
|
|
|
|
|
options:
|
|
|
|
|
backup:
|
|
|
|
|
tag:
|
|
|
|
|
- foo
|
|
|
|
|
- bar
|
|
|
|
|
```
|
|
|
|
|
|
2021-11-01 10:19:27 +00:00
|
|
|
|
## Priority
|
|
|
|
|
|
|
|
|
|
Options can be set globally, on the backends or on the locations.
|
|
|
|
|
|
|
|
|
|
The priority is as follows: `location > backend > global`.
|
|
|
|
|
|
2021-10-28 16:09:38 +00:00
|
|
|
|
## Global Options
|
2021-04-30 08:47:29 +00:00
|
|
|
|
|
2021-10-28 16:09:38 +00:00
|
|
|
|
It is possible to specify global flags that will be run every time restic is invoked. To do so specify them under `global` in your config file.
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
global:
|
|
|
|
|
all:
|
|
|
|
|
cache-dir: ~/restic
|
|
|
|
|
backup:
|
|
|
|
|
tag:
|
|
|
|
|
- foo
|
|
|
|
|
|
|
|
|
|
backends:
|
|
|
|
|
# ...
|
|
|
|
|
locations:
|
|
|
|
|
# ...
|
|
|
|
|
```
|