mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-25 01:44:43 +01:00
cmd: add repeat config option to Prune
This commit is contained in:
parent
8a96267ef4
commit
e048386cd5
@ -68,6 +68,7 @@ type Prune struct {
|
|||||||
DatasetFilter zfs.DatasetFilter
|
DatasetFilter zfs.DatasetFilter
|
||||||
SnapshotFilter zfs.FilesystemVersionFilter
|
SnapshotFilter zfs.FilesystemVersionFilter
|
||||||
RetentionPolicy *RetentionGrid // TODO abstract interface to support future policies?
|
RetentionPolicy *RetentionGrid // TODO abstract interface to support future policies?
|
||||||
|
Repeat jobrun.RepeatStrategy
|
||||||
}
|
}
|
||||||
|
|
||||||
type Autosnap struct {
|
type Autosnap struct {
|
||||||
@ -499,6 +500,7 @@ func parsePrune(e map[string]interface{}, name string) (prune *Prune, err error)
|
|||||||
Grid string
|
Grid string
|
||||||
DatasetFilter map[string]string `mapstructure:"dataset_filter"`
|
DatasetFilter map[string]string `mapstructure:"dataset_filter"`
|
||||||
SnapshotFilter map[string]string `mapstructure:"snapshot_filter"`
|
SnapshotFilter map[string]string `mapstructure:"snapshot_filter"`
|
||||||
|
Repeat map[string]string
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = mapstructure.Decode(e, &i); err != nil {
|
if err = mapstructure.Decode(e, &i); err != nil {
|
||||||
@ -540,6 +542,12 @@ func parsePrune(e map[string]interface{}, name string) (prune *Prune, err error)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Parse repeat strategy
|
||||||
|
if prune.Repeat, err = parseRepeatStrategy(i.Repeat); err != nil {
|
||||||
|
err = fmt.Errorf("cannot parse repeat strategy: %s", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +95,8 @@ prune:
|
|||||||
snapshot_filter: {
|
snapshot_filter: {
|
||||||
prefix: zrepl_hfbak_
|
prefix: zrepl_hfbak_
|
||||||
}
|
}
|
||||||
|
repeat:
|
||||||
|
interval: 10s
|
||||||
|
|
||||||
autosnap:
|
autosnap:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user