Release URBM 2026.06.15.r007
This commit is contained in:
@@ -329,6 +329,39 @@ func (s *Service) executeBackup(ctx context.Context, run model.Run) (result mode
|
||||
return failed(run, "source", "source unavailable: "+path)
|
||||
}
|
||||
}
|
||||
var imageSummary restic.Summary
|
||||
if job.Type == model.JobFlash && job.FlashImage {
|
||||
device, err := s.workloads.FlashDevice(ctx)
|
||||
if err != nil {
|
||||
return failedError(run, err)
|
||||
}
|
||||
image, err := os.Open(device)
|
||||
if err != nil {
|
||||
return failed(run, "source", "open USB flash device: "+err.Error())
|
||||
}
|
||||
appendLiveLog(&live, "USB-Rohabbild wird direkt aus "+device+" zu Restic übertragen")
|
||||
s.updateActive(live)
|
||||
imageSummary, err = s.restic.BackupImage(ctx, mounted.Repository, job, image, func(progress restic.Progress) {
|
||||
live.ProgressPercent = progress.PercentDone * 100
|
||||
live.ProgressBytes, live.ProgressTotal = progress.BytesDone, progress.TotalBytes
|
||||
live.ProgressFiles, live.ProgressFileTotal = progress.FilesDone, progress.TotalFiles
|
||||
live.SecondsRemaining = progress.SecondsRemaining
|
||||
live.CurrentFile = "urbm-usb-flash.img"
|
||||
s.updateActive(live)
|
||||
})
|
||||
closeErr := image.Close()
|
||||
if err != nil {
|
||||
appendLiveLog(&live, "USB-Rohabbild fehlgeschlagen: "+err.Error())
|
||||
failedRun := failedError(run, err)
|
||||
failedRun.LiveLog = live.LiveLog
|
||||
return failedRun
|
||||
}
|
||||
if closeErr != nil {
|
||||
return failed(run, "source", "close USB flash device: "+closeErr.Error())
|
||||
}
|
||||
appendLiveLog(&live, "USB-Rohabbild als urbm-usb-flash.img gesichert")
|
||||
s.updateActive(live)
|
||||
}
|
||||
appendLiveLog(&live, fmt.Sprintf("Restic-Backup gestartet: %d Quelle(n)", len(prepared.Sources)))
|
||||
s.updateActive(live)
|
||||
lastLoggedPercent := -5
|
||||
@@ -364,8 +397,12 @@ func (s *Service) executeBackup(ctx context.Context, run model.Run) (result mode
|
||||
} else {
|
||||
run.Status, run.Message = "success", "backup completed"
|
||||
}
|
||||
run.SnapshotID, run.BytesAdded, run.FilesNew, run.FilesChanged = summary.SnapshotID, summary.DataAdded, summary.FilesNew, summary.FilesChanged
|
||||
run.BytesProcessed, run.FilesProcessed = summary.TotalBytesProcessed, summary.TotalFilesProcessed
|
||||
run.SnapshotID = summary.SnapshotID
|
||||
run.BytesAdded = summary.DataAdded + imageSummary.DataAdded
|
||||
run.FilesNew = summary.FilesNew + imageSummary.FilesNew
|
||||
run.FilesChanged = summary.FilesChanged + imageSummary.FilesChanged
|
||||
run.BytesProcessed = summary.TotalBytesProcessed + imageSummary.TotalBytesProcessed
|
||||
run.FilesProcessed = summary.TotalFilesProcessed + imageSummary.TotalFilesProcessed
|
||||
run.ProgressPercent, run.ProgressBytes, run.ProgressTotal = 100, live.ProgressBytes, live.ProgressTotal
|
||||
run.ProgressFiles, run.ProgressFileTotal = live.ProgressFiles, live.ProgressFileTotal
|
||||
run.BytesPerSecond, run.SecondsRemaining, run.CurrentFile = live.BytesPerSecond, 0, live.CurrentFile
|
||||
|
||||
Reference in New Issue
Block a user