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
|
||||
SnapshotFilter zfs.FilesystemVersionFilter
|
||||
RetentionPolicy *RetentionGrid // TODO abstract interface to support future policies?
|
||||
Repeat jobrun.RepeatStrategy
|
||||
}
|
||||
|
||||
type Autosnap struct {
|
||||
@ -499,6 +500,7 @@ func parsePrune(e map[string]interface{}, name string) (prune *Prune, err error)
|
||||
Grid string
|
||||
DatasetFilter map[string]string `mapstructure:"dataset_filter"`
|
||||
SnapshotFilter map[string]string `mapstructure:"snapshot_filter"`
|
||||
Repeat map[string]string
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
// Parse repeat strategy
|
||||
if prune.Repeat, err = parseRepeatStrategy(i.Repeat); err != nil {
|
||||
err = fmt.Errorf("cannot parse repeat strategy: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -95,6 +95,8 @@ prune:
|
||||
snapshot_filter: {
|
||||
prefix: zrepl_hfbak_
|
||||
}
|
||||
repeat:
|
||||
interval: 10s
|
||||
|
||||
autosnap:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user