group zfsnap a bit more
This commit is contained in:
parent
f7df39f916
commit
a0cd2cdbcc
19
backup.go
19
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 {
|
for _, v := range a.Sources {
|
||||||
if *debugFlag {
|
takeSnapshot[v.Box()] = takeSnapshot[v.Box()] + " " + v.Path()
|
||||||
log.Printf("RunAppSchedule : taking %s snapshot for %s", schedule, v.Path())
|
refreshSnapshot[v.Box()] = true
|
||||||
|
|
||||||
}
|
}
|
||||||
err := cfg.ssh[v.Box()].exec("/usr/sbin/zfsnap snapshot -p '" + schedule + "-' -a " + cfg.Zfsnap[schedule] + " " + v.Path())
|
for k, v := range takeSnapshot {
|
||||||
|
if *debugFlag {
|
||||||
|
log.Printf("RunAppSchedule : taking %s snapshot on %s for%s", schedule, k, v)
|
||||||
|
}
|
||||||
|
err := cfg.ssh[k].exec("/usr/sbin/zfsnap snapshot -p '" + schedule + "-' -a " + cfg.Zfsnap[schedule] + v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if *debugFlag {
|
if *debugFlag {
|
||||||
log.Printf("RunAppSchedule : Error executing zfsnap on %s", string(v))
|
log.Printf("RunAppSchedule : Error executing zfsnap on %s", k)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
refreshSnapshot[v.Box()] = true
|
|
||||||
}
|
}
|
||||||
for _, v := range a.Destinations {
|
for _, v := range a.Destinations {
|
||||||
refreshSnapshot[v.Box()] = true
|
refreshSnapshot[v.Box()] = true
|
||||||
|
Loading…
Reference in New Issue
Block a user