v2 #2

Merged
shoopea merged 29 commits from v2 into master 2023-08-21 20:03:11 +02:00
2 changed files with 19 additions and 17 deletions
Showing only changes of commit 88220d47e6 - Show all commits

28
app.go
View File

@ -172,20 +172,22 @@ func (a *App) Cleanup(now time.Time) error {
} }
} }
for _, dest := range a.destinations { for _, dest := range a.destinations {
dest = dest.Append("/" + src.Box() + "/" + src.Path()) if cfg.box[dest.Box()].online {
for _, s := range cfg.box[dest.Box()].zfs.filesystems[dest.Path()].snapshots { dest = dest.Append("/" + src.Box() + "/" + src.Path())
if !s.Valid() { for _, s := range cfg.box[dest.Box()].zfs.filesystems[dest.Path()].snapshots {
if err := s.Delete(); err != nil { if !s.Valid() {
log.WithFields(log.Fields{"app": a.name, "now": now, "box": src.Box(), "snapshot": s.String(), "call": "Delete", "error": err}).Errorf("") if err := s.Delete(); err != nil {
return err log.WithFields(log.Fields{"app": a.name, "now": now, "box": src.Box(), "snapshot": s.String(), "call": "Delete", "error": err}).Errorf("")
} return err
} else if expired, err := s.Expired(now); err != nil { }
log.WithFields(log.Fields{"app": a.name, "now": now, "box": dest.Box(), "snapshot": s.String(), "call": "Expired", "error": err}).Errorf("") } else if expired, err := s.Expired(now); err != nil {
return err log.WithFields(log.Fields{"app": a.name, "now": now, "box": dest.Box(), "snapshot": s.String(), "call": "Expired", "error": err}).Errorf("")
} else if expired {
if err := s.Delete(); err != nil {
log.WithFields(log.Fields{"app": a.name, "now": now, "box": src.Box(), "snapshot": s.String(), "call": "Delete", "error": err}).Errorf("")
return err return err
} else if expired {
if err := s.Delete(); err != nil {
log.WithFields(log.Fields{"app": a.name, "now": now, "box": src.Box(), "snapshot": s.String(), "call": "Delete", "error": err}).Errorf("")
return err
}
} }
} }
} }

View File

@ -1,7 +1,7 @@
// Code generated by version.sh (@generated) DO NOT EDIT. // Code generated by version.sh (@generated) DO NOT EDIT.
package main package main
var githash = "2afd699" var githash = "1387868"
var branch = "v2" var branch = "v2"
var buildstamp = "2023-07-31_08:29:23" var buildstamp = "2023-07-31_08:33:33"
var commits = "68" var commits = "69"
var version = "2afd699-b68 - 2023-07-31_08:29:23" var version = "1387868-b69 - 2023-07-31_08:33:33"