From 2ae1737081e707feea105396c44f6c07876cfcb7 Mon Sep 17 00:00:00 2001 From: shoopea Date: Sat, 16 Apr 2022 21:30:47 +0800 Subject: [PATCH] fix --- app.go | 22 +++++++++++++--------- version.go | 8 ++++---- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/app.go b/app.go index cf67697..483c6fa 100644 --- a/app.go +++ b/app.go @@ -433,13 +433,15 @@ func (a AppConfig) CheckZFS() error { return fmt.Errorf("No path %s on source", string(src)) } for _, dest := range a.Destinations { - if !cfg.Box[dest.Box()].ZFSIsZFS(dest.Path() + "/" + src.Box() + "/" + src.Path()) { - err := cfg.Box[dest.Box()].ZFSCreateZFS(dest.Path() + "/" + src.Box() + "/" + src.Path()) - if err != nil { - if *debugFlag { - log.Printf("AppConfig.CheckZFS : %s : Error creating %s on %s", a.Name, dest.Path()+"/"+src.Box()+"/"+src.Path(), dest.Box()) + if cfg.Box[dest.Box()].online { + if !cfg.Box[dest.Box()].ZFSIsZFS(dest.Path() + "/" + src.Box() + "/" + src.Path()) { + err := cfg.Box[dest.Box()].ZFSCreateZFS(dest.Path() + "/" + src.Box() + "/" + src.Path()) + if err != nil { + if *debugFlag { + log.Printf("AppConfig.CheckZFS : %s : Error creating %s on %s", a.Name, dest.Path()+"/"+src.Box()+"/"+src.Path(), dest.Box()) + } + return err } - return err } } } @@ -658,9 +660,11 @@ func (a AppConfig) CleanupSnapshot() error { cleanupSnapshot := make(map[string]string) for _, dest := range a.Destinations { - for _, src := range a.Sources { - cleanupSnapshot[src.Box()] = cleanupSnapshot[src.Box()] + " " + src.Path() - cleanupSnapshot[dest.Box()] = cleanupSnapshot[dest.Box()] + " " + dest.Path() + "/" + src.Box() + "/" + src.Path() + if cfg.Box[dest.Box()].online { + for _, src := range a.Sources { + cleanupSnapshot[src.Box()] = cleanupSnapshot[src.Box()] + " " + src.Path() + cleanupSnapshot[dest.Box()] = cleanupSnapshot[dest.Box()] + " " + dest.Path() + "/" + src.Box() + "/" + src.Path() + } } } diff --git a/version.go b/version.go index e6a16ab..c4483ab 100644 --- a/version.go +++ b/version.go @@ -1,6 +1,6 @@ // Code generated by version.sh (@generated) DO NOT EDIT. package main -var githash = "cddb222" -var buildstamp = "2022-04-16_13:10:55" -var commits = "31" -var version = "cddb222-b31 - 2022-04-16_13:10:55" +var githash = "ed26114" +var buildstamp = "2022-04-16_13:30:39" +var commits = "32" +var version = "ed26114-b32 - 2022-04-16_13:30:39"