By default autorestic searches for a
.autorestic.yml file in the current directory and your home folder.
You can also specify a custom file with the
⚠️ WARNING ⚠️
Note that the data is automatically encrypted on the server. The key will be generated and added to your config file. Every backend will have a separate key. You should keep a copy of the keys or config file somewhere in case your server dies. Otherwise DATA IS LOST!
.autorestic.yml1version: 223locations:4 home:5 from: /home/me6 to: remote78 important:9 from: /path/to/important/stuff10 to:11 - remote12 - hdd1314backends:15 remote:16 type: b217 path: 'myBucket:backup/home'18 env:19 B2_ACCOUNT_ID: account_id20 B2_ACCOUNT_KEY: account_key2122 hdd:23 type: local24 path: /mnt/my_external_storage
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
b share the same hooks and forget policies.
.autorestic.yml1version: 223extras:4 hooks: &foo5 before:6 - echo "Hello"7 after:8 - echo "kthxbye"9 policies: &bar10 keep-daily: 1411 keep-weekly: 521213backends:14 # ...15locations:16 a:17 from: /data/a18 to: some19 hooks:20 <<: *foo21 options:22 forget:23 <<: *bar24 b:25 from: data/b26 to: some27 hooks:28 <<: *foo29 options:30 forget:31 <<: *bar