-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_autorestic.yml.tmpl
39 lines (36 loc) · 1.49 KB
/
dot_autorestic.yml.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
version: 2
extras:
healthchecks: &healthchecks
hooks:
before:
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Starting backup for location: ${AUTORESTIC_LOCATION}" https://hc-ping.com/{{ .restic.healthchecks }}/start'
failure:
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Backup failed for location: ${AUTORESTIC_LOCATION}" https://hc-ping.com/{{ .restic.healthchecks }}/fail'
success:
- "curl -m 10 --retry 5 -X POST -H \"Content-Type: text/plain\" --data \"Backup successful for location: ${AUTORESTIC_LOCATION}\n\nCreated snapshot: ${AUTORESTIC_SNAPSHOT_ID_0}\n\nProcessed files: ${AUTORESTIC_PROCESSED_FILES_0}\nProcessed duration: ${AUTORESTIC_PROCESSED_DURATION_0}\" https://hc-ping.com/{{ .restic.healthchecks }}"
locations:
home:
<<: *healthchecks
from: {{ .restic.path }}
to: remote
forget: prune
options:
forget:
keep-daily: 7 # keep 7 last daily snapshots
keep-weekly: 3 # keep 3 last weekly snapshots
keep-monthly: 2 # keep 2 last monthly snapshots
keep-yearly: 1 # keep 1 last yearly snapshots
backup:
exclude-if-present:
- .nobackup
- .git
exclude-file:
- {{ .restic.path }}/.excludes.txt
backends:
remote:
type: b2
path: '{{ .restic.repository }}'
key: {{ .restic.password }}
env:
B2_ACCOUNT_ID: {{ .restic.b2accountid }}
B2_ACCOUNT_KEY: {{ .restic.b2accountkey }}