group zfsnap a bit more
This commit is contained in:
parent
f7df39f916
commit
a0cd2cdbcc
17
backup.go
17
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
|
||||
|
Loading…
Reference in New Issue
Block a user