fix: store large log outputs in tar bundles of logs

This commit is contained in:
garethgeorge
2024-02-02 02:51:39 -08:00
parent 427792c724
commit 0cf01e0206
27 changed files with 572 additions and 413 deletions

View File

@@ -21,6 +21,7 @@ import (
"github.com/garethgeorge/backrest/internal/oplog"
"github.com/garethgeorge/backrest/internal/orchestrator"
"github.com/garethgeorge/backrest/internal/resticinstaller"
"github.com/garethgeorge/backrest/internal/rotatinglog"
"github.com/mattn/go-colorable"
"go.etcd.io/bbolt"
"go.uber.org/zap"
@@ -63,8 +64,14 @@ func main() {
}
defer oplog.Close()
// Create rotating log storage
logStore := rotatinglog.NewRotatingLog(path.Join(config.DataDir(), "rotatinglogs"), 30)
if err != nil {
zap.S().Fatalf("Error creating rotating log storage: %v", err)
}
// Create orchestrator and start task loop.
orchestrator, err := orchestrator.NewOrchestrator(resticPath, cfg, oplog)
orchestrator, err := orchestrator.NewOrchestrator(resticPath, cfg, oplog, logStore)
if err != nil {
zap.S().Fatalf("Error creating orchestrator: %v", err)
}
@@ -80,6 +87,7 @@ func main() {
configStore,
orchestrator,
oplog,
logStore,
)
apiAuthenticationHandler := api.NewAuthenticationHandler(authenticator)