diff --git a/backup.go b/backup.go index a9875c7..8bb9c66 100644 --- a/backup.go +++ b/backup.go @@ -533,20 +533,25 @@ func (a AppConfig) RunAppSchedule(schedule string) error { } } } - var refreshSnapshot map[string]bool - refreshSnapshot = make(map[string]bool) + + refreshSnapshot := make(map[string]bool) + takeSnapshot := make(map[string]string) for _, v := range a.Sources { + takeSnapshot[v.Box()] = takeSnapshot[v.Box()] + " " + v.Path() + refreshSnapshot[v.Box()] = true + + } + for k, v := range takeSnapshot { if *debugFlag { - log.Printf("RunAppSchedule : taking %s snapshot for %s", schedule, v.Path()) + log.Printf("RunAppSchedule : taking %s snapshot on %s for%s", schedule, k, v) } - err := cfg.ssh[v.Box()].exec("/usr/sbin/zfsnap snapshot -p '" + schedule + "-' -a " + cfg.Zfsnap[schedule] + " " + v.Path()) + err := cfg.ssh[k].exec("/usr/sbin/zfsnap snapshot -p '" + schedule + "-' -a " + cfg.Zfsnap[schedule] + v) if err != nil { if *debugFlag { - log.Printf("RunAppSchedule : Error executing zfsnap on %s", string(v)) + log.Printf("RunAppSchedule : Error executing zfsnap on %s", k) } return err } - refreshSnapshot[v.Box()] = true } for _, v := range a.Destinations { refreshSnapshot[v.Box()] = true