MCPcopy
hub / github.com/tuna/tunasync / ExtractSizeFromRsyncLog

Function ExtractSizeFromRsyncLog

internal/util.go:139–143  ·  view source on GitHub ↗

ExtractSizeFromRsyncLog extracts the size from rsync logs

(logFile string)

Source from the content-addressed store, hash-verified

137
138// ExtractSizeFromRsyncLog extracts the size from rsync logs
139func ExtractSizeFromRsyncLog(logFile string) string {
140 // (?m) flag enables multi-line mode
141 re := regexp.MustCompile(`(?m)^Total file size: ([0-9\.]+[KMGTP]?) bytes`)
142 return ExtractSizeFromLog(logFile, re)
143}
144
145// TranslateRsyncErrorCode translates the exit code of rsync to a message
146func TranslateRsyncErrorCode(cmdErr error) (exitCode int, msg string) {

Callers 3

RunMethod · 0.92
RunMethod · 0.92

Calls 1

ExtractSizeFromLogFunction · 0.85

Tested by 1