From 0083ab69070a5d0ce1106e85f4a160904b853154 Mon Sep 17 00:00:00 2001 From: shoopea Date: Sat, 16 Apr 2022 15:16:23 +0800 Subject: [PATCH] path creation fix --- app.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app.go b/app.go index 56071d0..32abe71 100644 --- a/app.go +++ b/app.go @@ -560,6 +560,18 @@ func (a AppConfig) SendSnapshots() (err error) { return } + if !cfg.Box[dest.Box()].ZFSIsZFS(dest.Path() + "/" + src.Box() + "/" + src.Path()) { + if *debugFlag { + log.Printf("AppConfig.SendSnapshots : %s : Creating on %s path %s", a.Name, dest.Box(), dest.Path()+"/"+src.Box()+"/"+src.Path()) + } + if err = cfg.Box[dest.Box()].ZFSCreateZFS(dest.Path() + "/" + src.Box() + "/" + src.Path()); err != nil { + if *debugFlag { + log.Printf("AppConfig.SendSnapshots : %s : Creating on %s path %s failed (%s)", a.Name, dest.Box(), dest.Path()+"/"+src.Box()+"/"+src.Path(), err) + } + return + } + } + if *debugFlag { log.Printf("AppConfig.SendSnapshots : %s : Initializing snapshot on %s from %s", a.Name, dest.Box(), string(sFirstSnapshot)) }