pull/103/head
cupcakearmy 3 years ago
parent dd6e618161
commit b9b8857bf4
No known key found for this signature in database
GPG Key ID: D28129AE5654D9D9

@ -40,4 +40,44 @@ backends:
path: /mnt/my_external_storage path: /mnt/my_external_storage
``` ```
## Aliases
A handy tool for more advanced configurations is to use yaml aliases.
These must be specified under the global `extras` key in the `.autorestic.yml` config file.
Aliases allow to reuse snippets of config throughout the same file.
The following example shows how the locations `a` and `b` share the same hooks and forget policies.
```yaml | .autorestic.yml
extras:
hooks: &foo
before:
- echo "Hello"
after:
- echo "kthxbye"
policies: &bar
keep-daily: 14
keep-weekly: 52
backends:
# ...
locations:
a:
from: /data/a
to: some
hooks:
<<: *foo
options:
forget:
<<: *bar
b:
from: data/b
to: some
hooks:
<<: *foo
options:
forget:
<<: *bar
```
> :ToCPrevNext > :ToCPrevNext

1057
docs/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -19,6 +19,7 @@ var VERBOSE bool = false
var CRON_LEAN bool = false var CRON_LEAN bool = false
type Config struct { type Config struct {
Extras interface{} `yaml:"extras"`
Locations map[string]Location `yaml:"locations"` Locations map[string]Location `yaml:"locations"`
Backends map[string]Backend `yaml:"backends"` Backends map[string]Backend `yaml:"backends"`
} }

Loading…
Cancel
Save