snapshot: Explicitly export Pathbuilders

This commit updates the 'wdcli snapshot' command to also export
pathbuilders from the system.
This commit is contained in:
Tom Wiesing 2022-09-09 10:12:18 +02:00
parent 477152814a
commit c4de1f2a06
No known key found for this signature in database
5 changed files with 125 additions and 6 deletions

19
env/snapshot.go vendored
View file

@ -86,6 +86,7 @@ type Snapshot struct {
ErrStop error
ErrBookkeep error
ErrPathbuilder error
ErrFilesystem error
ErrTriplestore error
ErrSSQL error
@ -145,6 +146,24 @@ func (snapshot *Snapshot) create(io stream.IOStream, instance Instance) {
_, snapshot.ErrBookkeep = fmt.Fprintf(info, "%#v\n", instance.Instance)
}()
// write pathbuilders
wg.Add(1)
go func() {
defer wg.Done()
pbPath := filepath.Join(snapshot.Description.Dest, "pathbuilders")
messages <- pbPath
// create the directory!
if err := os.Mkdir(pbPath, fs.ModeDir); err != nil {
snapshot.ErrPathbuilder = err
return
}
// put in all the pathbuilders
snapshot.ErrPathbuilder = instance.ExportPathbuilders(pbPath)
}()
// backup the filesystem
wg.Add(1)
go func() {