mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-28 19:34:58 +01:00
prototype new config format
This commit is contained in:
parent
64b4901eb0
commit
98fc59dbd5
36
cmd/sampleconf/localbackup/host1.yml
Normal file
36
cmd/sampleconf/localbackup/host1.yml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# mirror local pool to backup pool
|
||||||
|
local:
|
||||||
|
|
||||||
|
global:
|
||||||
|
snapshot_prefix: zrepl_
|
||||||
|
|
||||||
|
schedule:
|
||||||
|
type: auto # infer schedule from autosnap step
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- type: autosnap
|
||||||
|
interval: 10m
|
||||||
|
dataset_filter: {
|
||||||
|
"zroot<": ok
|
||||||
|
}
|
||||||
|
|
||||||
|
- type: pull
|
||||||
|
mapping: {
|
||||||
|
"zroot<":"backups/local/zroot"
|
||||||
|
}
|
||||||
|
|
||||||
|
- type: prune
|
||||||
|
policy: grid
|
||||||
|
grid: 1x1h(keep=all)
|
||||||
|
dataset_filter: {
|
||||||
|
"zroot<": ok
|
||||||
|
}
|
||||||
|
|
||||||
|
- type: prune
|
||||||
|
policy: grid
|
||||||
|
grid: 1x1h(keep=all) | 24x1h | 35x1d | 6x30d
|
||||||
|
dataset_filter: {
|
||||||
|
"backups/local/zroot<": ok
|
||||||
|
}
|
||||||
|
|
34
cmd/sampleconf/pullbackup/backuphost.yml
Normal file
34
cmd/sampleconf/pullbackup/backuphost.yml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
prod1.example.com:
|
||||||
|
|
||||||
|
connect:
|
||||||
|
type: ssh
|
||||||
|
host: backuphost.example.com
|
||||||
|
user: root
|
||||||
|
port: 22
|
||||||
|
identity_file: /root/.ssh/id_ed25519
|
||||||
|
|
||||||
|
schedule:
|
||||||
|
# we cannot infer a schedule from steps below, thus define one here
|
||||||
|
type: cron
|
||||||
|
cron: "@every 10m" # see https://godoc.org/github.com/robfig/cron
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
# pull datasets from remote to local
|
||||||
|
- type: pull
|
||||||
|
mapping: {
|
||||||
|
"zroot<":"storage/backups/zrepl/prod1.example.com/zroot"
|
||||||
|
"zroot/tmp": "!"
|
||||||
|
}
|
||||||
|
|
||||||
|
# prune the snaphots we pulled
|
||||||
|
- type: prune
|
||||||
|
policy: grid
|
||||||
|
grid: 1x1h(keep=all) | 24x1h | 35x1d | 6x30d
|
||||||
|
dataset_filter: {
|
||||||
|
"storage/backups/zrepl/prod1.example.com/zroot<": ok
|
||||||
|
}
|
||||||
|
snapshot_filter: {
|
||||||
|
snapshot_prefix: zrepl_
|
||||||
|
}
|
||||||
|
|
33
cmd/sampleconf/pullbackup/productionhost.yml
Normal file
33
cmd/sampleconf/pullbackup/productionhost.yml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
backuphost.example.com:
|
||||||
|
|
||||||
|
global:
|
||||||
|
snapshot_prefix: zrepl_
|
||||||
|
|
||||||
|
# accept connections from backups.example.com via ssh / stdinserver command
|
||||||
|
serve:
|
||||||
|
auth: ssh
|
||||||
|
role: source
|
||||||
|
acl: {
|
||||||
|
"zroot<": ok,
|
||||||
|
"zroot/usr/home<": omit,
|
||||||
|
}
|
||||||
|
|
||||||
|
# periodic task list, following given schedule
|
||||||
|
schedule:
|
||||||
|
type: auto # infer from autosnap step
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- type: autosnap
|
||||||
|
interval: 10m
|
||||||
|
dataset_filter: {
|
||||||
|
"zroot<": ok
|
||||||
|
}
|
||||||
|
|
||||||
|
- type: prune
|
||||||
|
policy: grid
|
||||||
|
grid: 1x1h(keep=all)
|
||||||
|
dataset_filter: {
|
||||||
|
"zroot<": ok
|
||||||
|
}
|
||||||
|
|
||||||
|
|
11
cmd/sampleconf/pushbackup/backuphost.yml
Normal file
11
cmd/sampleconf/pushbackup/backuphost.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
prod1.example.com:
|
||||||
|
|
||||||
|
global:
|
||||||
|
snapshot_prefix: zrepl_
|
||||||
|
|
||||||
|
# accept connections from prod1.example.com via ssh / stdinserver command
|
||||||
|
serve:
|
||||||
|
auth: ssh
|
||||||
|
role: sink
|
||||||
|
root: storage/backups/zrepl/sink/prod1.example.com
|
||||||
|
|
47
cmd/sampleconf/pushbackup/productionhost.yml
Normal file
47
cmd/sampleconf/pushbackup/productionhost.yml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# push backup to backups.example.com
|
||||||
|
backups.example.com:
|
||||||
|
|
||||||
|
connect:
|
||||||
|
type: ssh
|
||||||
|
host: 192.168.122.128
|
||||||
|
user: root
|
||||||
|
port: 22
|
||||||
|
identity_file: /root/.ssh/id_ed25519
|
||||||
|
connlog_read_file: /tmp/connlog_read
|
||||||
|
connlog_write_file: /tmp/connlog_write
|
||||||
|
|
||||||
|
global:
|
||||||
|
snapshot_prefix: zrepl_
|
||||||
|
|
||||||
|
schedule:
|
||||||
|
type: auto
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
# take local snapshots & keep window of one day
|
||||||
|
- type: autosnap
|
||||||
|
interval: 10m
|
||||||
|
dataset_filter: {
|
||||||
|
"zroot/var/db<": ok,
|
||||||
|
"zroot/usr/home<": ok,
|
||||||
|
}
|
||||||
|
- type: prune
|
||||||
|
policy: grid
|
||||||
|
grid: 1x1d(keep=all)
|
||||||
|
dataset_filter: {
|
||||||
|
"zroot/var/db<": ok,
|
||||||
|
"zroot/usr/home<": ok,
|
||||||
|
}
|
||||||
|
|
||||||
|
# push datasets to remote and prune there
|
||||||
|
# if these jobs fail, we have one day until we are out of sync
|
||||||
|
- type: push
|
||||||
|
dataset_filter: {
|
||||||
|
"zroot/var/db<": ok,
|
||||||
|
"zroot/usr/home<": ok,
|
||||||
|
}
|
||||||
|
- type: prune
|
||||||
|
remote: true
|
||||||
|
policy: grid
|
||||||
|
grid: 1x1h(keep=all) | 24x1h | 35x1d | 6x30d
|
||||||
|
|
Loading…
Reference in New Issue
Block a user