mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2024-12-22 08:16:25 +00:00
aliases
This commit is contained in:
parent
dd6e618161
commit
b9b8857bf4
@ -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
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…
Reference in New Issue
Block a user