mirror of
https://github.com/zrepl/zrepl.git
synced 2025-08-14 09:08:24 +02:00
WIP: Switch to new config format.
Don't use jobrun for daemon, just call JobDo() once, the job must organize stuff itself. Sacrifice all the oneshot commands, they will be reintroduced as client-calls to the daemon.
This commit is contained in:
25
cmd/config_fsvfilter.go
Normal file
25
cmd/config_fsvfilter.go
Normal file
@ -0,0 +1,25 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/zrepl/zrepl/zfs"
|
||||
"strings"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type PrefixSnapshotFilter struct {
|
||||
Prefix string
|
||||
}
|
||||
|
||||
func parsePrefixSnapshotFilter(i string) (f *PrefixSnapshotFilter, err error) {
|
||||
if !(len(i) > 0) {
|
||||
err = errors.Errorf("snapshot prefix must be longer than 0 characters")
|
||||
return
|
||||
}
|
||||
f = &PrefixSnapshotFilter{i}
|
||||
return
|
||||
}
|
||||
|
||||
func (f *PrefixSnapshotFilter) Filter(fsv zfs.FilesystemVersion) (accept bool, err error) {
|
||||
return fsv.Type == zfs.Snapshot && strings.HasPrefix(fsv.Name, f.Prefix), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user