mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-22 00:13:52 +01:00
config: source job: rename field 'datasets' to 'filesystems'
While filesystems is also not the right term (since it excludes ZVOLs), we want to stay consistent with comments & terminology used in docs. BREAK CONFIG fixes #17
This commit is contained in:
parent
b95260f4b5
commit
3e647c14c0
@ -13,7 +13,7 @@ import (
|
||||
type SourceJob struct {
|
||||
Name string
|
||||
Serve AuthenticatedChannelListenerFactory
|
||||
Datasets *DatasetMapFilter
|
||||
Filesystems *DatasetMapFilter
|
||||
SnapshotPrefix string
|
||||
Interval time.Duration
|
||||
Prune PrunePolicy
|
||||
@ -24,7 +24,7 @@ func parseSourceJob(c JobParsingContext, name string, i map[string]interface{})
|
||||
|
||||
var asMap struct {
|
||||
Serve map[string]interface{}
|
||||
Datasets map[string]string
|
||||
Filesystems map[string]string
|
||||
SnapshotPrefix string `mapstructure:"snapshot_prefix"`
|
||||
Interval string
|
||||
Prune map[string]interface{}
|
||||
@ -42,7 +42,7 @@ func parseSourceJob(c JobParsingContext, name string, i map[string]interface{})
|
||||
return
|
||||
}
|
||||
|
||||
if j.Datasets, err = parseDatasetMapFilter(asMap.Datasets, true); err != nil {
|
||||
if j.Filesystems, err = parseDatasetMapFilter(asMap.Filesystems, true); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ func (j *SourceJob) JobStart(ctx context.Context) {
|
||||
log := ctx.Value(contextKeyLog).(Logger)
|
||||
defer log.Info("exiting")
|
||||
|
||||
a := IntervalAutosnap{DatasetFilter: j.Datasets, Prefix: j.SnapshotPrefix, SnapshotInterval: j.Interval}
|
||||
a := IntervalAutosnap{DatasetFilter: j.Filesystems, Prefix: j.SnapshotPrefix, SnapshotInterval: j.Interval}
|
||||
p, err := j.Pruner(PrunePolicySideDefault, false)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("error creating pruner")
|
||||
@ -111,7 +111,7 @@ func (j *SourceJob) Pruner(side PrunePolicySide, dryRun bool) (p Pruner, err err
|
||||
p = Pruner{
|
||||
time.Now(),
|
||||
dryRun,
|
||||
j.Datasets,
|
||||
j.Filesystems,
|
||||
j.SnapshotPrefix,
|
||||
j.Prune,
|
||||
}
|
||||
@ -158,7 +158,7 @@ outer:
|
||||
}
|
||||
|
||||
// construct connection handler
|
||||
handler := NewHandler(log, j.Datasets, &PrefixSnapshotFilter{j.SnapshotPrefix})
|
||||
handler := NewHandler(log, j.Filesystems, &PrefixSnapshotFilter{j.SnapshotPrefix})
|
||||
|
||||
// handle connection
|
||||
rpcServer := rpc.NewServer(rwc)
|
||||
|
@ -28,7 +28,7 @@ jobs:
|
||||
client_identity: fullbackup_prod1
|
||||
|
||||
# snapshot these filesystems every 10m with zrepl_ as prefix
|
||||
datasets: {
|
||||
filesystems: {
|
||||
"zroot/var/db<": "ok",
|
||||
"zroot/usr/home<": "ok",
|
||||
"zroot/var/tmp": "!", #don't backup /tmp
|
||||
|
@ -11,7 +11,7 @@ jobs:
|
||||
identity_file: /root/.ssh/id_ed25519
|
||||
|
||||
# snapshot these datsets every 10m with zrepl_ as prefix
|
||||
datasets: {
|
||||
filesystems: {
|
||||
"zroot/var/db<": "ok",
|
||||
"zroot/usr/home<": "!",
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ jobs:
|
||||
serve:
|
||||
type: stdinserver
|
||||
client_identity: debian2
|
||||
datasets: {
|
||||
filesystems: {
|
||||
"pool1/db<": ok
|
||||
}
|
||||
snapshot_prefix: zrepl_
|
||||
|
@ -109,7 +109,7 @@ func doTestDatasetMapFilter(cmd *cobra.Command, args []string) {
|
||||
case *PullJob:
|
||||
mf = j.Mapping
|
||||
case *SourceJob:
|
||||
mf = j.Datasets
|
||||
mf = j.Filesystems
|
||||
case *LocalJob:
|
||||
mf = j.Mapping
|
||||
default:
|
||||
|
@ -94,7 +94,7 @@ jobs:
|
||||
- name: pull_backup
|
||||
type: source
|
||||
...
|
||||
datasets: {
|
||||
filesystems: {
|
||||
"zroot/var/db": "ok",
|
||||
"zroot/usr/home<": "ok",
|
||||
"zroot/usr/home/paranoid": "!",
|
||||
|
@ -102,7 +102,7 @@ jobs:
|
||||
serve:
|
||||
type: stdinserver
|
||||
client_identity: backup-srv.example.com
|
||||
datasets: {
|
||||
filesystems: {
|
||||
"zroot/var/db": "ok",
|
||||
"zroot/usr/home<": "ok",
|
||||
"zroot/usr/home/paranoid": "!",
|
||||
|
Loading…
Reference in New Issue
Block a user