fix snapshot taking

This commit is contained in:
shoopea 2021-10-19 08:45:51 +08:00
parent 2bf1227ee6
commit 413373622f

12
app.go
View File

@ -456,12 +456,8 @@ func (a AppConfig) TakeSnapshot(schedule string) error {
} }
takeSnapshot := make(map[string]string) takeSnapshot := make(map[string]string)
delSnapshot := make(map[string]string)
for _, v := range a.Sources { for _, v := range a.Sources {
takeSnapshot[v.Box()] = takeSnapshot[v.Box()] + " " + v.Path() takeSnapshot[v.Box()] = takeSnapshot[v.Box()] + " " + v.Path()
for _, v2 := range a.Destinations {
delSnapshot[v2.Box()] = delSnapshot[v2.Box()] + " " + v2.Path() + "/" + v.Box() + "/" + v.Path()
}
} }
for k, v := range takeSnapshot { for k, v := range takeSnapshot {
if *debugFlag { if *debugFlag {
@ -642,6 +638,14 @@ func (a AppConfig) RunAppBackup() error {
} }
return err return err
} }
err = a.TakeSnapshot(schedule)
if err != nil {
if *debugFlag {
log.Printf("AppConfig.RunAppBackup : %s : TakeSnapshot : %s", a.Name, err)
}
return err
}
} }
err = a.RefreshSnapshot() err = a.RefreshSnapshot()