From 413373622fe9c836e103fc900794eb2dbcab3494 Mon Sep 17 00:00:00 2001 From: shoopea Date: Tue, 19 Oct 2021 08:45:51 +0800 Subject: [PATCH] fix snapshot taking --- app.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app.go b/app.go index 60f8df5..859c0f6 100644 --- a/app.go +++ b/app.go @@ -456,12 +456,8 @@ func (a AppConfig) TakeSnapshot(schedule string) error { } takeSnapshot := make(map[string]string) - delSnapshot := make(map[string]string) for _, v := range a.Sources { 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 { if *debugFlag { @@ -642,6 +638,14 @@ func (a AppConfig) RunAppBackup() error { } 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()